Set up payment attribution
Payment attribution helps you identify which content creator’s link referred to the user who made the purchase. All purchases made by that user are linked to the creator, so they can receive accurate payouts based on campaign results.
How it works
To enable attribution, use the tracking_id
parameter.
The tracking_id
is a unique identifier that links a user’s payment to a traffic source (e.g., an advertising campaign). It is used to:
- track the performance of campaigns
- identify which creator referred the user
- collect analytics in Partner Network
- correctly calculate rewards and payouts
The tracking_id
is generated by Xsolla when a user clicks a content creator’s personal link. As the user follows this link, Xsolla automatically appends the tracking_id
parameter, a unique 32-character identifier, to the URL. The link may point to the Web Shop’s main page, a specific item, or a promotion, depending on the campaign. You must pass the tracking_id
in the request to generate a payment token. After the transaction is completed, the tracking_id
is saved with the payment data and is used for attribution, analytics, and financial reporting.
Example: https://webshop-external-demo.xsolla.site/?tracking_id=abcdefghijklmnopqrstuvwxyz123456
tracking_id
is not passed, the payment won’t be attributed to a traffic source, won’t appear in the performance report, and won’t be included in payouts to creators.tracking_id
when generating a payment token:- Get the tracking_id from the query parameters in the URL.
- Save it to the browser's
localStorage
. - Include tracking_id in the request to generate the payment token.
Get tracking_id
Getting the tracking_id
parameter on the client side depends on your integration type. You can either implement your own logic for extracting tracking_id
, or use the Partner Network tracking script provided by Xsolla.
tracking_id
may be lost.tracking_id
to localStorage
and provides access to the getTrackingId()
method.Detailed implementation examples are provided in the tabs below.
Pass tracking_id when generating payment token
Depending on how your integration is set up, use one of the options below to pass the tracking_id
to the token generation method.
tracking_id
is included in the token request.Found a typo or other text error? Select the text and press Ctrl+Enter.