I want to add the Facebook Pixels PagesView and ViewContent in my Amp Page.
Here is my Code:
<amp-analytics type="facebookpixel" id="facebook-pixel">
<script type="application/json">
{
"vars": {
"pixelId": "xy"
},
"triggers": {
"trackPageview": {
"on": "visible",
"request": "pageview"
},
"trackViewContent": {
"on": "visible",
"request": "eventViewContent",
"extraUrlParams": {
"content_category": "open article"
}
}
}
}
</script>
</amp-analytics>
The Pageview works but for the ViewContent I always get warnings in the Facebook Pixel Helper. The resulting POST request to Facebook from AMP is this: https://www.facebook.com/tr?noscript=1&ev=ViewContent&id=xy&cd%5Bvalue%5D=&cd%5Bcurrency%5D=&cd%5Bcontent_name%5D=open%20article&cd%5Bcontent_type%5D=&cd%5Bcontent_ids%5D=&dt=o4haxxaf7ij6ugv6b3p7cy2qybh9e8rd
So it is sending all sorts of empty parameters to FB. Most of the standard event parameters for Facebook pixel are optional. I don't want that they send all the parameters. I just want to send the content_category..
Use following config: