I recently took on a client who had a website built in Duda, which I had never worked in before.
So I go to add the Google Tag Manager script in the most logical place – under SEO & SETTINGS > GOOGLE TOOLS > GOOGLE TAG MANAGER.
But when I paseted my tag there, it told me that it was an invalid GTM ID.
So, after a bit of research and playing around, I figured out what you have to do:
Step 1: Get your GTM scripts
Go into Google Tag Manager and get your tagging instructions from Admin > Install Google Tag Manager:
Step 2: Paste the tags into your Head/Body end HTML
Take the <head> tag and paste it into the Head HTML, then take the <body> tag and paste it into the Body end HTML.
Keep in mind that in Duda, the first box on this page is for the Body end HTML and the second is for the Head HTML (whereas Google Tag Manager displays the head code first, then the body). So make sure you paste the right code into the right box.
Step 3: Paste your GTM Container ID into Google Tools
Now when we go to paste our GTM code into Duda, it should work and not tell us that our code is invaid.
Where do I get my Container ID in Google Tag Manager?
When you’re in Google Tag Manager, just click on Admin and you should see the container ID at the top of the CONTAINER box.