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

Notice
If 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.
To pass tracking_id when generating a payment token:
  1. Get the tracking_id from the query parameters in the URL.
  2. Save it to the browser's localStorage.
  3. 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.

Notice
Make sure the script runs before any other JavaScript that modifies the URL. Otherwise, the tracking_id may be lost.
We recommend using the Partner Network tracking script — it automatically saves 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.

Notice
To ensure accurate attribution, make sure tracking_id is included in the token request.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: September 23, 2025

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!
We couldn't send your feedback
Try again later or contact us at doc_feedback@xsolla.com.