How to fix AMP analytics tracking via GTM

130 Views Asked by At

We've set up AMP Analytics tracking via GTM container, but there's no data being tracked/sent to GA. How can we fix this?

As per GTM container's installation instructions, in the head tag we have the first part of the tracking code + few other AMP Components:

<!-- AMP Analytics -->
    <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-story" src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script>
    <script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
    <script async custom-element="amp-facebook" src="https://cdn.ampproject.org/v0/amp-facebook-0.1.js"></script>

In the body tag we have the second part of GTM code, which developers placed in between the amp-story-grid-layer component:

<amp-story-grid-layer template="fill">
                <!--<amp-analytics type="gtag" config="gtm_config.json" data-credentials="include"></amp-analytics>-->
                <amp-analytics config="https://www.googletagmanager.com/amp.json?id=GTM-PSKWH26&amp;gtm.url=SOURCE_URL" data-credentials="include"></amp-analytics>
            </amp-story-grid-layer>

I expect to see data being tracked in Google Analytics, but there's currently no data being tracked.

0

There are 0 best solutions below