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;
CAUTION
Do not use a randomization function to generate a purchase ID.

Analytics