GTM not firing when page is cached

Created on 19 May 2022, about 3 years ago
Updated 9 February 2023, over 2 years ago

Problem/Motivation

My tag manager works fine when I'm logged into the site. As soon as I log out and I'm looked at the cached version of the site, my tags won't fire. I've looked through the chrome plugin and inspected the page source to locate the GTM snippet. I am unable to find it.

Steps to reproduce

Create GTM container and tags within it.
Place container code into tagmanager's config page.
watch it load up the container when logged in.
log out and I'm seeing it not render.

Proposed resolution

Is there an option to include this module through my caching mechanism? I use "internal page cache" and "Pantheon Advanced Page Cache" as my solution.

My dev and test environments load up the GTM script but my Live environment does not.

Not sure what I'm missing here, any help is greatly appreciated. Thanks.

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada kevinkang

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India shree.yesare

    Any solution on issue? I am able to reproduce the same with version 8.x-1.6

  • 🇮🇳India shree.yesare

    The issue related rendering of GTM snippet for anonymous user was fixed by turning on Negate the condition for Moderation Dashboard Access.

  • 🇺🇸United States kevinting

    Enabling the "Negate the condition" setting worked for me. I was in a similar problem with GTM not being rendered on the page.
    But where did this Moderation Dashboard Access setting come from? My other sites don't have this extra setting.

Production build 0.71.5 2024