Skip to content

Instantly share code, notes, and snippets.

@lassiter
Last active October 3, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lassiter/5f0c8a70a0591b8af4627a0923adb0f9 to your computer and use it in GitHub Desktop.
Save lassiter/5f0c8a70a0591b8af4627a0923adb0f9 to your computer and use it in GitHub Desktop.
<script>
ga('ec:addProduct', { // Provide product details in an productFieldObject.
'id': 'P12345', // Product ID (string).
'name': 'Android Warhol T-Shirt', // Product name (string).
'category': 'Apparel', // Product category (string).
'brand': 'Google', // Product brand (string).
'variant': 'black', // Product variant (string).
'price': '29.20', // Product price (currency).
'coupon': 'APPARELSALE', // Product coupon (string).
'quantity': 1 // Product quantity (number).
});
ga('ec:setAction', 'purchase', { // Transaction details are provided in an actionFieldObject.
'id': 'T12345', // (Required) Transaction id (string).
'affiliation': 'Google Store - Online', // Affiliation (string).
'revenue': '37.39', // Revenue (currency).
'tax': '2.85', // Tax (currency).
'shipping': '5.34', // Shipping (currency).
'coupon': 'SUMMER2013' // Transaction coupon (string).
});
</script>
@lassiter
Copy link
Author

lassiter commented Oct 2, 2017

TODO: Determine the WooCommerce PHP Variables and Input them into the header of the custom pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment