I was also curious about what happens if you don't follow Google's guidelines in setting up on-page code.
By combining my numbers with those from my colleague Dom Woodman's site (you're welcome for the link, Dom), which uses the Drupal Analytics add-on as well as GTM, I was able to see the difference between Google Tag Manager and the incorrect code on the page (just below the <body> tag). I then got all my data into the Google 5 setup.
The effect of GTM and the placement of the code on the page are incorrect.
Traffic as a percentage of baseline (standard Google Tag Manager implementation):
The code on the page usually reports more traffic than GTM.
Modified code is usually within the margin of error, except for modified GTM code on Internet Explorer (see note below).
Analytics code in the wrong place will benin number data cost you a third of your traffic vs. code implemented correctly on the page, depending on the browser (!).
Custom setups, which are designed to get more traffic to avoid ad blockers, are doing nothing.
It's also worth noting that the custom implementation actually got less traffic than the standard one. For the code on the page, this is within the margin of error, but for Google Tag Manager, there's another reason — because I used unfiltered profiles for comparison, there's a lot of bot spam in the main profile , which is basically masquerading as Internet Explorer. Our main profile is by far the most spammed, and is also serving as the baseline here, so the difference between the code on the page and Google Tag Manager is probably a bit more than I'm reporting.
Here are a few key points:
-
- Posts: 192
- Joined: Tue Jan 07, 2025 4:36 am