Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order Placed #16

Open
Nayuken opened this issue Sep 13, 2024 · 7 comments
Open

Order Placed #16

Nayuken opened this issue Sep 13, 2024 · 7 comments
Assignees

Comments

@Nayuken
Copy link
Collaborator

Nayuken commented Sep 13, 2024

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
@Nayuken
Copy link
Collaborator Author

Nayuken commented Oct 31, 2024

@rafaeltorresharvard @stephen-g-goss
Can either of you please provide a test card to be able to complete the purchase flow?

Image

@elizabethbrady-ep
Copy link
Collaborator

@rafaeltorresharvard please @stephen-g-goss please provide instructions on how to submit a test purchase. Please note we'll be reviewing the value parameter and will be checking that it does NOT have a currency symbol in it (similar to add to cart event)

@Nayuken
Copy link
Collaborator Author

Nayuken commented Nov 1, 2024

@stephen-g-goss @rafaeltorresharvard
Wanted to inform you both that It appears that the payment portal needed for this event to trigger is currently down during testing. This is a hard blocker for us to be able to test the values of the order placed event.

Image

@Nayuken
Copy link
Collaborator Author

Nayuken commented Nov 4, 2024

Feedback:

@stephen-g-goss & @rafaeltorresharvard The "order placed" event is missing from the data layer after a course purchase is completed and the user reaches Harvard's payment confirmation page. This event should be added to the data layer once the payment is finalized through the Touchnet portal, and it should appear on the confirmation page following the page load started event.

Image

@Nayuken
Copy link
Collaborator Author

Nayuken commented Nov 5, 2024

Feedback:

The dataLayer is now populating correctly when a user returns to the "payment complete" page during course registration. However, the behavior differs from what was shown in the original screenshot. Currently, the item_name field in the dataLayer displays "December 10 - January 15." Was this intentional? If not, this field should instead reflect the specific course the user is applying for, rather than the current value.

Further's Event Validation:

Event Parameter Result
pr1 item_name = December 10 - January 15 item_brand = Harvard Online item_id = test1234clotho price = 1600 discount = -480 item_quantity = 1 course_name = December 10 - January 15 program_date = February 24, 2025 - July 2, 2025
cu USD
ep.coupon 30%
epn.value 1120
ep.site_section CRP
ep.site_section2 CRP
ep.type CRP
ep.course_name December 10 - January 15
ep.program_dates February 24, 2025 - July 02, 2025
ep.payment_method Visa
epn.tax 0
ep.transaction_id 20241105000011
{
  event: "purchase",
  detailed_event: "Order Placed",
  ecommerce: {
    coupon: "30%",
    currency: "USD",
    items: [
      {
        item_name: "December 10 - January 15",
        item_id: "test1234clotho",
        item_brand: "Harvard Online",
        price: 1600,
        discount: -480,
        quantity: 1,
        course_name: "December 10 - January 15",
        program_dates: "February 24, 2025 - July 02, 2025"
      }
    ],
    payment_method: "Visa",
    tax: 0,
    transaction_id: "20241105000011",
    value: 1120
  },
  gtm.uniqueEventId: 176
}

@elizabethbrady-ep
Copy link
Collaborator

@Nayuken @rafaeltorresharvard item name should be the SAME as course_name it should not be a date

@Nayuken
Copy link
Collaborator Author

Nayuken commented Nov 13, 2024

Confirming that LXP is now populating the correct item:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants