Skip to content

Commit

Permalink
Adding code for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
annagav committed Oct 18, 2024
1 parent ccaba5e commit 826884d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main/templates/partials/gtm_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@
gtag('config', '{{ APIKEYS.GTM_TRACKING_ID }}');
</script>
{% endif %}

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ event: 'purchase', ecommerce: {
transaction_id: 'abc123', // order or transaction id
value: 50.00, // total purchase value excluding discounts
tax: 0.00,
shipping: 0.00,
currency: 'USD',
coupon: '5off', // coupon code the user used. leave blank if none
items: [ {
item_id: 'MITxT+14.100x', // course ID
item_name: 'Microeconomics', //course name
affiliation: 'MITx Online', coupon: '5off', discount: 5.00, item_category: "MicroMasters", // course category if possible
price: 50.00, quantity: 1 } ] } });
</script>

0 comments on commit 826884d

Please sign in to comment.