Sales Attribution for Magento 2
The Sales Attribution module for Magento 2 allows store owners to track revenue generated by affiliates through unique reference codes in URL links. The admin panel displays Affiliate IDs on all orders and allows for easy export these data or fetch using REST API.
The module can be configured to include the specific products or any website pages in the URL links. It provides an efficient solution for establishing an affiliate marketing program.
- Helpful in tracking the revenue generated by multiple affiliates
- Ability to manage Affiliate ID cookie lifespan
- Flexible tracking of inbound affiliate traffic
- Affiliate IDs can be easily tracked in export data/via REST API
Features
What does the Sales Attribution module do?
Sales Attribution module allows store owners to track sales generated by their affiliates through the use of unique IDs in URLs. The module works around specific parameters that must be present in the URL links used by affiliates for promotion.
Affiliates need to add a unique reference code to the URLs they publish that links to your website, and when users click through the unique affiliate ID will be linked to the customer's session. When this customer places an order, this order will have the unique ID of the affiliate to easily track the person.
How the module works


- Clicking the first link, the customers will be redirected to the product page (product SKU is 24-WG088); the affiliate ID value will get stored in their browser cookie. The customers can buy this (or any other) product - the order will have the affiliate ID.
- Clicking the second link, the customers will be redirected to the CMS page (About Us); the affiliate ID will still get stored in the session and if they make any purchase, the affiliate ID will be stored for this order.
For each order, the Affiliate ID field can be viewed on all orders created using the above-mentioned links. The Affiliate ID field is part of the order data. Therefore, the store owner can easily filter orders from Admin Sales Order Grid.
This value will also be available when exporting order data so the store owner can easily track sales generated by the affiliates.
The Affiliate ID can be fetched using the REST API Orders endpoint.




The store owner sets a time limit for recognizing the customers who initially came to the website through an affiliate. Orders within that timeframe have an Affiliate ID taken from the session cookie.
Afterwards, customers are considered regular, and the affiliate_id is no longer tracked.