• search console is telling me I have the following error:
    The script tag contains invalid JSON that cannot be parsed.

    it highlights this section of code:
    <script type="application/json">{"vars": {"account": "UA-117909482-1" //Replace this with your Tracking ID

    When I click the LEARN MORE link, I see this snippet:
    TAG
    script

    STATUS IN AMP HTML
    Prohibited unless the type is application/ld+json. (Other non-executable values may be added as needed.) Exception is the mandatory script tag to load the AMP runtime and the script tags to load extended components.

    Can you offer any suggestions on fixing this error?
    Thank you!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor ampforwp

    (@ampforwp)

    Hi @t0nydean,

    Will you please tell me how you are adding the analytics in AMP version? and you don’t need to do anything just enable this option and add the ID – https://prnt.sc/lrdgwr and your analytics will start tracking.

    Thread Starter t0nydean

    (@t0nydean)

    That is exactly what I have done, as well as switched on the ‘advanced analytics’ button and the ‘IP Anonymization’ button. The advanced analytics code is like this:

    {
        "vars": {
            "account": "UA-117909482-1"  //Replace this with your Tracking ID
        },
        "triggers": {
            "trackPageview": {
                "on": "visible",
                "request": "pageview",
            },
        /** 
         * Enter your Advanced Analytics code here
        */
    
        }
    }

    I believe the tracking is working, its just giving me validation warnings about the AMP compliance.

    • This reply was modified 7 years, 6 months ago by t0nydean.
    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @t0nydean,

    As the tracking is working, can you tell me what are the validation warnings you’re facing on your end so that I can check and solve them for you?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘analytics error in search console’ is closed to new replies.