AMP-Linker - The script tag contains invalid JSON that cannot be parsed

1.5k Views Asked by At

I received the following notification in GSC

The script tag contains invalid JSON that cannot be parsed."

It came up a couple of days after we enabled the linker feature.

This is the amp-analytics code:

<body>
<amp-analytics type="googleanalytics">
<script type="application/json">
{
"vars": {
"account": "XXXXXXXXXXXX"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
}
}
"linkers": {
      "enabled": true
    }
}
</script>

Any advice on what might be wrong?

Thanks in advance :)

1

There are 1 best solutions below

0
On

Missing comma after triggers: {...},