For the complete documentation index, see llms.txt. This page is also available as Markdown.

Checkout Tracking

Track completed purchases with checkout items and configured field roles.

The ff-checkout-tracking element sends a checkout tracking request for each ff-checkout-tracking-item in its DOM. Generate these elements server-side after checkout completes. Each product needs its own item with record-id.

Optionally provide count, price, and channel:

  • count is the number of purchased items. It defaults to 1.

  • price is the item price. When absent, it is inferred from the clicked item and configured field roles.

  • channel selects the tracking channel. When absent, the ff-communication default applies.

<ff-checkout-tracking>
    <ff-checkout-tracking-item record-id="10321926" count="5" channel="NEW_CHANNEL"></ff-checkout-tracking-item>
    <ff-checkout-tracking-item record-id="10321938" count="3" price="9.99"></ff-checkout-tracking-item>
    <ff-checkout-tracking-item record-id="10321943" count="1"></ff-checkout-tracking-item>
</ff-checkout-tracking>

Documentation

Disable auto-tracking

The tracking requests are sent immediately after the element has finished initializing. You can disable this behavior by setting the property disable-auto-tracking like so:

This enables you to manipulate the ff-checkout-tracking-item child elements on the client-side. Consequentially, you will have to manually invoke ff-checkout-tracking's trackCheckoutItems() function through JavaScript.

Field roles

Set fieldRoles manually so ff-checkout-tracking resolves the correct fields:

Replace the example values with your field names. Retrieve the configuration by running a search on a page using FactFinder Web Components. Then open browser DevTools and run:

ff-checkout-tracking requires FactFinder's Record API. It does not work without Record API support.

API code

ff-checkout-tracking

Properties

Properties
Name
Description

disable-auto-tracking (Boolean) (default: false)

Controls whether the element sends a tracking request upon its rendering.

Methods

Methods
Name
Description

trackCheckoutItems()

Dispatches a tracking checkout event for each of its ff-checkout-tracking-item children.

ff-checkout-tracking-item

Properties

Properties
Name
Description

record-id (String) (default: empty)

The item's ID used for tracking in FactFinder.

count (String) (default: "1")

Number of pieces of this item that were bought.

price (String)

Price of the item bought. If omitted, it will be inferred from the clicked item and the configured fieldRoles.

channel (String)

Channel used to send a tracking request. If omitted, the default value configured in ff-communication will be used.

Last updated

Was this helpful?