purchaseID
The purchaseID
variable helps prevent hits containing the same purchase from inflating reports. For example, if a visitor reaches your purchase confirmation page, you typically send data around the revenue generated from the transaction to ÃÛ¶¹ÊÓƵ. If the user refreshes this page multiple times or bookmarks the page to visit later, those hits can inflate reports. The purchaseID
variable de-duplicates metrics when more than one hit has the same purchase ID.
When ÃÛ¶¹ÊÓƵ recognizes a hit as a duplicate purchase, all conversion data (such as eVars and events) do not show in reporting. In data feeds, the duplicate_purchase
column is set to 1
.
Purchase ID’s apply to all visitors and expire after 37 months. If one visitor sets a given purchase ID, then a different visitor sets that same purchase ID a year later, the second purchase is de-duplicated.
Purchase ID using the Web SDK
Purchase ID is mapped to the following variables:
- XDM object:
xdm.commerce.order.purchaseID
- Data object:
data.__adobe.analytics.purchaseID
Purchase ID using the ÃÛ¶¹ÊÓƵ Analytics extension
You can set purchase ID either while configuring the Analytics extension (global variables) or under rules.
- Log in to using your ÃÛ¶¹ÊÓƵID credentials.
- Click the desired tag property.
- Go to the Rules tab, then click the desired rule (or create a rule).
- Under Actions, click an existing ÃÛ¶¹ÊÓƵ Analytics - Set Variables action or click the ‘+’ icon.
- Set the Extension drop-down list to ÃÛ¶¹ÊÓƵ Analytics, and the Action Type to Set Variables.
- Locate the Purchase ID section.
You can set purchase ID to a value or a data element. You can also copy the value from another Analytics variable.
s.purchaseID in AppMeasurement and the Analytics extension custom code editor
The s.purchaseID
variable is a string that contains a unique identifier to a purchase. It is set on the same hit as a purchase event. Only use alpha-numeric characters to populate this variable.
This variable can store a maximum of 20 bytes; values longer than 20 bytes are truncated. If this truncated value matches subsequent truncated values, those subsequent hits are de-duplicated.
s.purchaseID = "ABC123";
If using the digitalData
data layer:
s.purchaseID = digitalData.transaction.transactionID;