LogoLogo
Support
Front End Tracking
Front End Tracking
  • Introduction to front-end tracking
  • Setup guide
    • Prerequisites
    • FHR activities
    • XO Search activities
    • XO Recommendations activities
  • Implementation guide
    • SDK
    • Google Tag Manager
    • REST API
  • Identities
    • User object
    • Working with identities
  • Activities
    • Activity object
    • View
    • Click
    • Add to cart
    • Remove from cart
    • Purchase
    • Custom actions
  • AI Scores
    • Setup
    • Usage
  • Best practice
  • Data handling
  • Acronyms and abbreviations
Powered by GitBook

Copyright @ 2024 Crownpeak Technology, Inc. All rights reserved.

On this page
  1. Activities

Purchase

Track purchase actions to analyze performance. Send separate events for each distinct product, and group multiple purchases using the order ID.

This section is relevant for both FHR and XO customers.

Purchase actions are key to analyzing performance, as they are used to calculate purchase conversion rates and revenues. They can only be performed on confirmation of purchase.

You should send a new purchase event for each distinct product, even if they are purchased as part of the same action.

To group multiple purchases, use the orderId field as described below.

Properties

{
    "action":"purchase",
    "target": {
        "product":"product-id"
    },
    "metadata": {
        "orderId": "order-id",
        "price": 3250,
        "quantity": 1,
        "currency": "EUR"
    }
}
Properties
Context
Description

action

All

Must be specified as "purchase"

target.product

All

The ID of the product that was purchased; must be identical with the product ID used in FHR/XO

metadata.*

All

Additional information, such as context or locale

metadata.quantity

All

The quantity of the product that was purchased

metadata.price

All

The price of the product that was purchased; must:

  • be in cents (i.e. without decimals)

  • be the product price, not the purchase total

  • take into account any discounts applied to the purchase

metadata.currency

All

metadata.orderId

All

The ID of the purchase order as defined by your platform

Each tracker key can only be used with a single currency.

Use the metadata.orderId to group purchase events, i.e. when a customer buys multiple products together.

You do not need to include a source ID for this event.

PreviousRemove from cartNextCustom actions

Last updated 3 months ago

The currency of the price, in format

ISO 4217