Support » Plugin: AMP » Facebook Pixel to Analytics Options

  • Resolved OJDille

    (@ojdille)


    Hey,

    any idea how to add Facebook pixel analytics using the plugin’s Analytics option? I keep getting the “Failed to save the analytics entry. Please make sure that the JSON configuration is valid and unique” message when I try to insert code.

    What’s wrong with this kind of code snippet? What would be the way to correct it?

    <amp-analytics type="facebookpixel" id="facebook-pixel">
        <script type="application/json">
        {
            "vars": {
                "pixelId": "YOUR_ID"
            },
            "triggers": {
                "trackPageview": {
                    "on": "visible",
                    "request": "pageview"
                }
            }
        }
        </script>
    </amp-analytics>

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Are you pasting this entire snippet into the textarea? You should only include the contents of the script element, the JASON that starts and ends with curly braces.

    Plugin Author Weston Ruter

    (@westonruter)

    *JSON

    Thanks so much for the response. I finally got what I was looking for and the problem is solved 🙂 So here’s a working code snippet for anyone who might have same difficulties:

    
    {
            "vars": {
                "pixelId": "PIXELID"
            },
            "triggers": {
                "trackPageview": {
                    "on": "visible",
                    "request": "pageview"
                }
            }
        }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Facebook Pixel to Analytics Options’ is closed to new replies.