Skip to content

Instantly share code, notes, and snippets.

@marcusRB
Last active October 14, 2018 09:46
Show Gist options
  • Select an option

  • Save marcusRB/4a8c784930fb38f910c056adb88b314a to your computer and use it in GitHub Desktop.

Select an option

Save marcusRB/4a8c784930fb38f910c056adb88b314a to your computer and use it in GitHub Desktop.
ProductDetails as ViewContent for custom tag of Facebook Ads on Google Tag Manager
/* ProductDetails as ViewContent for Google Tag Manager - Update 10.2018 MR//PD
Trigger: Service webpage or Product webpage page loaded
Remember: Set Tag Sequencing load before main pageView FBads tag
*/
<script>
fbq('track', 'ViewContent', {
value: {{cJS - EEC - product.detail.price}}, //product detail Price as FLOAT
currency: 'EUR', // currency as STRING
content_ids: {{cJS - dlv - product.id}}, //shows first 10 elements only for large ecommerce. objectType ARRAY
content_type: 'product', // choose between products or product_group
product_catalog_id: '{{FB ads - product_catalog_id}}', // ID of product Catalog on Facebook repository
content_name: '{{cJS - dlv - productName}}', // name of product, STRING
content_category: '{{cJS - dlv - categoryList}}', // category of product, STRING and concat with '>'
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment