Set up payment attribution

Payment attribution lets you identify which content creator referred a user who made a purchase. All purchases made by that user are attributed to that content creator, ensuring they receive the correct campaign payouts.

Notice
If purchases are made through a creator storefront or a page created with Xsolla site builder, no additional payment attribution setup is required — it works automatically. If you are using a custom storefront, follow the instructions below.

How it works

To enable attribution, use the tracking_id parameter.

The tracking_id is a unique identifier that is used to:

  • track the performance of campaigns
  • identify which creator referred the user
  • collect analytics in Partner Network
  • correctly calculate rewards and payouts

When a user follows a content creator’s personal link, Xsolla generates a unique 32-character tracking_id and appends it to the URL of the destination page. The destination can be any landing page associated with selling products. Pass the generated tracking_id in the request to generate a payment token. After the transaction is completed, the tracking_id is stored with the payment data and is used for attribution, analytics, and financial calculations.

Example of a link with a tracking_id parameter: https://webshop-external-demo.xsolla.site/?tracking_id=abcdefghijklmnopqrstuvwxyz123456

Notice
Without a tracking_id, the payment can’t be attributed to a traffic source. Such payments aren’t included in the performance report and aren’t considered when calculating payouts to the creator.

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

Retrieving the tracking_id on the client side depends on your integration type. You can either implement your own logic to extract the tracking_id or use the Partner Network script provided by Xsolla. Payment attribution works the same regardless of the type of sales pages, including storefronts, individual items or game key pages, and multi-game catalogs.

Notice
Make sure the script runs before any other JavaScript that modifies the URL. Otherwise, the tracking_id may be lost.

This script automatically extracts tracking_id from the URL’s query parameters and saves it to localStorage. To retrieve the stored value, the getTrackingId() method is provided, which is called when generating a payment token.

Detailed implementation examples are provided in the tabs below.


Regardless of how you integrate it — using the JavaScript snippet or the Partner Network script — call XsollaPartnerNetwork.getTrackingId() to retrieve the stored tracking_id:

Copy
Full screen
Small screen
1const trackingId = XsollaPartnerNetwork.getTrackingId();
2if (trackingId) {
3  console.log('Saved tracking_id from URL:', trackingId);
4  // add tracking_id into your request parameters
5}

Pass tracking_id when generating payment token

Depending on how you set up your integration, 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: July 17, 2026

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.