further-external / VPAL

An Apollo generated Event Driven Data Layer
0 stars 2 forks source link

Order Placed #16

Open Nayuken opened 1 month ago

Nayuken commented 1 month ago

Order Placed

CRP flow: Fire this on the order confirmation page when the user returns from the payment platform. Fire this after the page load completed event on the page.

Javascript Code

window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
dataLayer.push({
  "event": "purchase",
  "detailed_event": "Order Placed",
    "ecommerce": {
        "coupon": "<coupon>",
        "currency": "<currency>",
        "items": [

           {
                "item_name": "<item_name>",
                "item_id": "<item_id>",
                "item_brand": "<item_brand>",
                "item_category": "<item_category>",
                "price": <price>,
                 "discount": <discount>,
                "quantity": <quantity>,
                "course_name": "<course_name>",
                "program_dates": "<program_dates>",
            }

        ],
        "payment_method": "<payment_method>",
        "tax": <tax>,
        "transaction_id": "<transaction_id>",
        "value": <value>
    }
});

Image

Variable Definitions

Path Type Description Example Pattern Min Length Max Length Minimum Maximum Multiple Of
ecommerce.coupon string Order-level coupon code used for a purchase. returning_learner
ecommerce.currency string The currency, in 3-letter ISO 4217 format.
ecommerce.items[n].course_name string Value for Course Name. ex 'Financial Analysis and Valuation for Lawyers' Financial Analysis and Valuation for Lawyers, Data Privacy and Technology
ecommerce.items[n].course_price string Value for Course Price. ex. '1600' 1600, 945, 125.00
ecommerce.items[n].item_brand string Item brand Harvard Online
ecommerce.items[n].item_category string Item Category (context-specific) Include course categories similar to grouping on Harvard Online, if available
ecommerce.items[n].item_id string Item ID (context-specific).The product primary ID (SKU or UPC) Clotho_id for course
ecommerce.items[n].item_name string Item Name (context-specific). Same value as Course Name
ecommerce.items[n].price number The monetary price of the item, in units of the specified currency parameter. This is with discounte applied 9.99
ecommerce.items[n].discount number The monetary value of discount in units of the specified currency parameter. 2.00
ecommerce.items[n].program_dates string Value for Program Dates. ex. May 11, 2022 – May 10, 2023 May 11, 2022 – May 10, 2023
ecommerce.items[n].quantity integer Item quantity. 1
ecommerce.payment_method string Captures the payment methods used for a transaction (i.e. credit card, Visa, MasterCard, Amex, Paypal, purchase order, etc). Credit Card, PayPal, Mastercard, Visa, Amex, Discover
ecommerce.tax number Tax cost associated with a transaction. 1.11
ecommerce.transaction_id string The unique identifier of a transaction. T_12345, 19283j2nm9jdjs ^[a-zA-Z0-9]{6,20}$ 6 20
ecommerce.value number The monetary value of the event. quantity x sale price 7.77, 239.55, 659

Further's Event Validation

Event Parameter Result
pr1
cu
ep.coupon
ep.payment_method
epn.tax
ep.transaction_id
epn.value