Dev Request: Dev Request - Checkout

Status: Complete
Last updated: November 08, 2022 3:35 PM MST
Originally delivered at: October 28, 2021 6:00 PM MDT

Instructions

Intro

When the Google Tag Manager library loads it declares a global JS object, dataLayer. It overloads the array prototype .push method so that it can grab on to objects/"events" pushed to that array.

Notes/Questions

  • What values are possible there for customer.status?
  • Populate customer.hubspot_canonical_vid, customer.auth0_id, chargebee_id if available. If not available, keep the key and use value javascript undefined.

Other Notes

data.value is the cart total (including tax and shipping, if any, minus any discounts) in whole currency units e.g. dollars not cents

data.currency is the 3 character currency code

data.discount_amount is number of total dollars discounted from the cart.

data.items.list_price is the undiscounted price per unit

data.items.unit_price is the discounts-applied price per unit

data.items.discount is the per-unit discount

data.items is an array e.g. contains multiple objects if there are multiple line items in the cart

Data Layer Event: checkout

Triggering Conditions

Occurs after selection of "checkout with card" on the index of sales.pdq.com.

PDQ Checkout 1

followed by:

PDQ Checkout 2

Event should fire after sequentially after route load of /checkout, if possible.

Event to Log

<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    'event': 'checkout',
    'data': {}
  });
</script>

Description of Data Fields

checkout

Validation Schema does not have properties

JSON Validation Schema

For Super Techies:

The event payload, everything under the data property, will be validated against this schema. For more see JSONSchema standard.

{
  "TBD": "TBD"
}