• Resolved evavioletta

    (@evavioletta)


    Hello everyone, I am looking for help with AMP plugin – the Analytics Option. I cunfigurated all due to the documentation, but there are no real-time data in Google Analytics, whem I am on AMP version (under the google domain) of the page.
    I tried to resolve it with the Google Tag Manager by adding two containers on the site – one for AMP and one for WEB, but I can not add the AMP GTM script to the header of AMP vesrion of the site.
    Thank you very much for any help.
    Violetta

    • This topic was modified 4 years, 10 months ago by evavioletta.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • @evavioletta It looks like you may have entered ampanalytics as opposed to googleanalytics as the type field in your Analytics configuration. The type field is used to differentiate the providers.

    You’ll find out more here.

    Let me know if that works for you.

    Thread Starter evavioletta

    (@evavioletta)

    @jamesosborne thank you for your answer, but I don’t think that this will help.
    In the “Learn about analytics for AMP” section there is written, that: “Do not include any HTML tags like amp-analytics or <script>. A common entry would have the type googleanalytics (see available vendors) and a configuration that looks like the following (where UA-XXXXX-Y is replaced with your own site’s account number)”

    And I have done it like that:
    my JSON Configuration:

    {
    “vars”: {
    “account”: “UA-163231407-1”
    },
    “triggers”: {
    “trackPageview”: {
    “on”: “visible”,
    “request”: “pageview”
    }
    }
    }

    Do you have any other suggestions, please?

    Thank you very much.
    Violetta

    Plugin Author Alberto Medina

    (@albertomedina)

    @evavioletta,

    Not sure if you copied that JSON directly from your configuration but as is it has JSON validation errors (the quotes used do not parse). Perhaps that is not the case, but good to check.

    Looking at some of your pages, I can see the amp-analytics component tag in the page, but it is empty. The JSON configuration is not there.

    <amp-analytics config="https://www.googletagmanager.com/amp.json?id=GTM-KWJVZPG&gtm.url=SOURCE_URL" data-credentials="include" class="i-amphtml-layout-fixed i-amphtml-layout-size-defined" style="width:1px;height:1px;" i-amphtml-layout="fixed"></amp-analytics>

    Have you checked this documentation? https://developers.google.com/analytics/devguides/collection/amp-analytics

    Thread Starter evavioletta

    (@evavioletta)

    Hello @albertomedina,
    Yes, I checked the documentation, but still don’t know how to solve it.
    The JSON is copied directly from the AMP plugin Analytics section instructions with just added UA-ID.
    And the type=”gtag” – which use to be there by the documentation – is already in the code.
    I just used the Analytics section of the plugin and followed the instructions.
    Is there anything else, that I have to do?
    Thank you very much for another kick ??

    Thread Starter evavioletta

    (@evavioletta)

    @albertomedina so I have to put the GTM code you send me to <head>, right?
    Could it be on all the pages of my site or only on the AMP pages?

    • This reply was modified 4 years, 9 months ago by evavioletta.

    @evavioletta Apologies for the delay in responding. The “Type” field within the plugins analytics tab is used to associate any JSON configuration with a particular vendor, so it’s important to include the googleanalytics type.

    You’ll see an example here, showing the live report.

    Let me know if that works for you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘AMP analytics is not sending data to GA’ is closed to new replies.