Creating Custom Affiliate Program in Magento 2
In this article, you will learn how to create and configure your Custom Affiliate Program in the Affiliate Programs module for Magento 2. Please, check the following step-by-step guide.
Step-by-Step action:
- Go to the “Plumrocket” tab in the main menu.
- Navigate to the “Affiliate Programs” tab > select “Manage Affiliate Programs“.
Step-by-Step action:
- Press on the “Add New Affiliate” button.
Step-by-Step action:
- From the list of the affiliate programs select “Custom“.
- Press the “Continue” button.
Configuring Custom Affiliate Program in Magento 2
After you created new Custom Affiliate Program, you need to configure it. Please, follow the steps below.
Step-by-Step action:
- Specify the “Name” of your Affiliate Program.
- The “Status” option allows you to enable or disable the Affiliate Program.
- In the “Store View” section you may select the store view(s) where your Magento 2 Affiliate Program will be executed.
Step-by-Step action:
- The “JavaScript Library File” option allows you to upload the JavaScript Library File which to be executed.
- The ” Code” field allows you to insert the code which you need to execute.
- The “Execute On” option allows you to select the page(s) where you want the JavaScript Library File and Code to be executed.
Step-by-Step action:
- Repeat the steps 1-3 from the previous screenshot in this section, if necessary.
- Repeat the steps 1-3 from the previous screenshot in this section, if necessary.
- Press on the “Save” button, when all the changes have been performed.
List of available variables
Variable | Description |
---|---|
order_subtotal | Order Subtotal |
order_id | Order ID |
order_date | Order Date |
order_coupon_code | Coupon Code used for Order |
order_discount_amount | Discount Amount in the Order |
order_tax_amount | Tax Amount in the Order |
order_currency_code | Currency Symbol in the Order |
customer_email | Customer Email Address |
customer_name | Customer Name |
delivery_country | Country of Delivery |
Testing Custom Affiliate Tracking Code in Magento 2
In order to test and check whether your Magento 2 Affiliate Program has been installed properly, please check the instructions below.
Step-by-Step action:
- Please go to the page on which you indicated the JavaScript Library File or Code to be executed.
- Using your browser’s Developer Tool (“F12” key on your keyboard) open the search bar (“Ctrl+F” keys on your keyboard) and look for the JavaScript Library File or Code which you uploaded for execution.
Once you locate the JavaScript Library File or Code which you uploaded for execution – this means that your Custom Affiliate Program has been set up correctly. Now log into your account at Affiliate Network you have configured and verify that your transactions are being tracked correctly.