- Issue created by @jodavidson
- πΊπΈUnited States g.paluch
Confirming, after switching from 1.x to 2.0.2 I have the same issue, google tag js script tag is not present.
- πΊπΈUnited States g.paluch
Uninstalling and installing back module fixed the issue for me.
- πΊπΈUnited States ddavisboxleitner
On our project the issue appeared to be a container configuration file which was created using the 1.x version and when imported into the 2.x version caused the problem. After importing the 'stale' config the GTM snippet no longer appeared on the page.
The problem file was named like `google_tag.container.your_container_name.yml` and deleting the file, then uninstalling/re-installing google_tag module and importing config again resolved the issue.
We recommend checking your configs for any containers created in the old version of the module and try removing those config files, then re-import.
- π¨π¦Canada jodavidson
We recommend checking your configs for any containers created in the old version of the module and try removing those config files, then re-import.
Daniel, that seems reasonable. I've reverted to get things going again (marketing gets a little huffy when their tracking isn't working.)
I'll give it a go on a dev site and report back. If this is the fix the doumentation should be updated to note the process.
- π¨π¦Canada nbeaucage Montreal
This happened to us just now, and we found out that our container configuration was not properly setting the user_role condition.
Previously we were matching the anonymous user role only (for the condition), but since upgrading to the 2.x version of the module, the negate sub-property was set to true instead of our initial/expected false value.
So instead of having GTM fire off for anonymous users, it was firing for all authenticated users.
Setting the conditions.user_role.negate YAML property to false, and then re-importing our container configuration file fixed the issue for us (with a subsequent cache rebuild).
We feel that the upgrade process from 1.x to 2.x wrongly translated the YAML property role_toggle: 'include listed' to conditions.user_role.negate: true instead of negate: false. Might be wrong about this though, just throwing out some ideas.
We are also running into the script not appearing on our page.
Debugging the issue, it appears that some conditions in TagContainerResolver::passesConditions were throwing MissingValueContextException exceptions. Since this sets $missing_value to FALSE, the function returns FALSE and the tag isn't included.
Taking inspiration from Issue 3100588 β , we have patched the code to ignore when $missing_value is FALSE and the tag is now included.
It appears to be working for us, but we are not sure of the broader implications.
- πΊπΈUnited States jjeffrie
I recently transitioned from Google Analytics to Google Tag and have also encountered this bug. I decided to add the
and tags to my theme template file (html.html.twig). I can configure the tag behavior from the Google Tag Manager portal. I am also having this issue when trying to both add a new gtm container to a new site and while editing any existing containers as well. william.thomas.cox #8 π Google Tag script not appearing on page Active I tried your solution but this did not work for me. Is there any way you could post your patch? I am curious to see if there is anything you did differently.
- πΊπΈUnited States firewaller
@william.thomas.cox can you post your patch that fixed this?
- πΊπΈUnited States firewaller
I think what's happening is if any of the conditions fail then the tag won't show up (i.e. you can't use both a positive node and a term condition). This logic likely needs to be revisited: https://git.drupalcode.org/project/google_tag/-/blob/2.0.x/src/TagContai...
- Status changed to Needs review
8 months ago 2:33pm 8 April 2024 - last update
8 months ago 52 pass, 1 fail - πΊπΈUnited States mikeryan Murphysboro, IL, USA
The key point from the issue description is "Response code 403, 404 excluded" - we have the exact same situation. The problem is simply that the
ResponseCode
condition plugin is not applying negation. Patch attached. The last submitted patch, 13: 3396981-negate-response-codes-13.patch, failed testing. View results β