Skip to content

Instantly share code, notes, and snippets.

@juliantrumper
Created January 1, 2020 10:27
Show Gist options
  • Save juliantrumper/450cb6a1c38eee86cbee87707607a7af to your computer and use it in GitHub Desktop.
Save juliantrumper/450cb6a1c38eee86cbee87707607a7af to your computer and use it in GitHub Desktop.
<script>
var dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'transaction',
'ecommerce': {
'purchase': {
'actionField': {
'id': '{תוכן דינמי}', // Transaction ID. Required for purchases and refunds.
'revenue': '{תוכן דינמי}', // Total transaction value (incl. tax and shipping)
'tax': '{תוכן דינמי}',
'shipping': '{תוכן דינמי}',
'coupon': '{תוכן דינמי}'
},
'products': [{ // List of productFieldObjects.
'name': '{תוכן דינמי}', // Name or ID is required.
'id': '{תוכן דינמי}',
'price': '{תוכן דינמי}',
'category': '{תוכן דינמי}',
'variant': '',
'quantity': '{תוכן דינמי}',
'coupon': '{תוכן דינמי}' // Optional fields may be omitted or set to empty string.
},
{
'name': '{תוכן דינמי}',
'id': '{תוכן דינמי}',
'price': '{תוכן דינמי}',
'category': '{תוכן דינמי}',
'variant': '',
'quantity': {תוכן דינמי} }]
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment