C2S – WooCommerce – Manual
Discover the most-read articles
The manual integration for WooCommerce replaces the Affilae plugin: you install the tracking tag and the conversion code in your WordPress theme yourself. It requires two codes, one on all pages, the other in the functions.php file.
Track partner clicks
This code goes on all pages of your website, inside the <body> tag.
Where to install the code, via the theme
- Go to WordPress Admin > Appearance > Theme Editor.
- Select header.php or theme.php.
- Add the code inside the
<body>tag.
Code to install:
Where to find your Program ID? Affilae Admin > Configuration > Tracking tab > Integration via an Affilae plugin section. Replace PROGRAM_ID with that value.
Track sales
This code goes in the functions.php file of your WordPress theme. It fires on the WooCommerce thank-you page.
Where to install the code
- Go to WordPress Admin > Appearance > Theme Editor.
- Click Theme Functions (functions.php).
- Add the code at the very top, right after the
<?phpline.
Code to install:
The variable to update
Replace the sample key YOUR.KEY with your conversion key.
Where to find your key? Affilae Admin > Configuration > Tracking tab > Integration via an Affilae plugin section. Select the matching rule, then copy its Key.
What the conversion code does
It automatically reports the following data, with nothing for you to fill in.
- The unique order number.
- The net amount, excluding taxes and shipping fees.
- The promo codes used.
- The IDs of the purchased products.
- The applied discounts.
Three calculation rules to keep in mind.
- Final amount = total price, minus taxes, minus shipping fees, minus discounts.
- Multiple products: a list separated by a semicolon.
- Multiple promo codes: a list separated by a semicolon.
Your installation checklist
Installation
- Tracking code added to all pages.
- Conversion code added in functions.php.
- Variables replaced with actual values.
Test
- Click and conversion tests performed.
- Verified in the Affilae dashboard.
- Test documentation followed.
Related articles
- C2S – WooCommerce
- C2S – Manual
- Testing click and conversion tracking
- Affilae tracking fundamentals
- How to create and track vouchers
Frequently asked questions
Verify that the Program ID is correct. Then make sure the code is present on all pages of the site, not only on the home page.
Verify that the conversion key is correct, then that the code is in functions.php. Test with a real order, and make sure WooCommerce is up to date.
The plugin does the same job without you touching your theme code, and it is configured from the WordPress admin. The manual integration is for cases where you cannot install the plugin, or where your theme needs a custom setup.
The final amount sent is the total order price, minus taxes, minus shipping fees, minus discounts. That value is the basis for the commission calculation.
As a list separated by a semicolon. The conversion code assembles the product IDs and the promo codes of the order by itself.
In Affilae, open your program Configuration, then the Tracking tab. The Integration via an Affilae plugin section shows the Program ID and, for each selected rule, its Key.