Skip to content

Instantly share code, notes, and snippets.

@marcusRB
Created October 14, 2018 16:52
Show Gist options
  • Save marcusRB/e7f1ef540c3e12d5e28e8d1b03223a71 to your computer and use it in GitHub Desktop.
Save marcusRB/e7f1ef540c3e12d5e28e8d1b03223a71 to your computer and use it in GitHub Desktop.
ProductPurchase as custom Event for Google Tag Manager
/* ProductPurchase as custom Event for Google Tag Manager - Update 10.2018 MR//PD
Trigger: tag fire when customEvent 'transaction' or similar purchase event, populate dataLayer at the end of transaction (after payment gateway or on thank you page)
Remember: Set Tag Sequencing load before main pageView FBads tag
*/
<!--Product Purchase from Hybris only - Update 09.2018 MR//PD -->
<script>
fbq('track', 'Purchase', {
value: {{EE - Revenue}}, //purchase revenue as FLOAT
currency: 'EUR',
contents: {{dlv - EEC ecommerce.purchase.products}}, //shows array of purchase
content_type: 'product',
product_catalog_id: '{{FB ads - product_catalog_id}}',
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment