Skip to content

Instantly share code, notes, and snippets.

@marcusRB
Created October 14, 2018 11:01
Show Gist options
  • Save marcusRB/d406d83e291c2f9c610920470c806978 to your computer and use it in GitHub Desktop.
Save marcusRB/d406d83e291c2f9c610920470c806978 to your computer and use it in GitHub Desktop.
WishList as ViewContent for Google Tag Manager
/* WishList as ViewContent for Google Tag Manager - Update 10.2018 MR//PD
Trigger: Service webpage or Product webpage when fire Wishlist button or custom event
Remember: Set Tag Sequencing load before main pageView FBads tag
*/
/*Update 28.09.2018 v2 MR//PD
Product addToWishList from categoryList and detailProduct -
NOTE: script use DOM scraping, please check last version of your CMS for to get the values,
instead doesn\'t work well or value returned will be null
*/
<script>
fbq('track', 'AddToWishlist', {
value: {{cJS - EEC - product.detail.price}}, //product detail Price as FLOAT
currency: 'EUR', // currency as STRING
content_ids: {{wishlist prodId}}, //shows 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 - favoriteName}}', // 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