- Issue created by @ioana apetri
- πΊπΈUnited States jmester13
I'm running 2.0.4 and also getting this in Search Console.
tag is being places inside the
- πΊπΈUnited States jmester13
Update here, be sure to check you GA account settings.
Admin > Account > Account Details. Be sure that Data Processing Terms is unchecked. My website is US based and doesn't have GDPR requirements.
- π·π΄Romania ioana apetri
Can you provide me more details, how to set up this option? I can't find any 'Data Processing Terms'.
Thank you! Hi all! Our team has started receiving the following error on Google Analaytics: Your Google Tag code isnβt configured correctly, which may soon prevent your property from measuring automatic events. To fix this, place your Google Tag configuration code in the correct location on all pages that measure events.
We presume this is because of the new GTM updates that require script tags to be placed in the head tag, rather than the body tag. Currently, this module only places a script tag in the body of our site.
How have people configured the tags to show up in the head? And has anyone else encountered this GTM error before?
Thank you :)- π©πͺGermany marcusx
I can confirm that Google complains about the placement of the gtag.js script.
See:
https://support.google.com/tagmanager/answer/14847097?sjid=4908559106955...Copy the first block of code and paste it as high in the tag as possible.
I patched the
google_tag.libraries.yml
file. Can someone confirm that this creates not a problem elsewhere?I also had to switch off consent mode (on the Google_tag settings page, at the bottom) (which switches on the default gtag settings) and put the default values manually in the head tag at the very first line. I was unable to alter the module logic to achieve this goal through an alter API call. But I had not enough time to dig deep into that. Considering that, putting the settings into
html.html.twig
a hack. Better ideas are appreciated.<head> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('consent', 'default', { 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'ad_storage': 'denied', 'analytics_storage': 'denied', 'wait_for_update': 500, }); gtag('js', new Date()); </script>
- Status changed to Needs review
5 months ago 11:55am 23 July 2024 - First commit to issue fork.
- Status changed to Fixed
5 months ago 10:29pm 25 July 2024 -
japerry β
committed 1886891b on 2.0.x
Issue #3452712: Possibly script loading/placement issue
-
japerry β
committed 1886891b on 2.0.x
- π¬π§United Kingdom newaytech
Thanks for all the work on the GTM module - sorry I didn't see this issue earlier to chime in...
We use CookieBot to set consent - so need opportunity for that to load - provide consent signals to the dataLayer - for us to then utilise those within the framework of GTM. At the moment with this addition - the placement of all the Google Tag code in the header is causing the dataLayer events to be pushed prior to consent being delivered by CookieBot. The other side effect here is that we pull a heap more Javascript up into the head - slowing the perceived page rendering speed by Google.
Is it possible for me to retrospectively apply a dependency on my CookieBot cookie library such that the cookie code always runs first - at the moment it is being called after the gtag / ajax & gtm javascript files...
Automatically closed - issue fixed for 2 weeks with no activity.
- π¨π¦Canada adixon
This patch should be reverted asap, it causes issues with Olivero. See below:
https://www.drupal.org/project/drupal/issues/3474666 π Olivero theme have an error for Drupal 10.3 Active
https://www.drupal.org/project/google_tag/issues/3468036#comment-15811949 π Problems with google tag i think after it upgraded to 2.0.6 Active