Article

C2S – Manual

The manual integration means installing two Affilae scripts on your website yourself: the tracking tag on all pages, and the conversion tag on the confirmation page. Use this method when no plugin matches your technology.

Prerequisites: the URL format of your program must be set as a parameter. You can edit the URL format in your program Configuration, under Global settings. Have your Program ID and your Key at hand.
Warning: never send personal data in the parameters, for example a name, a surname or an e-mail address.

Check your CSP configuration

If your server enforces a content security policy, it must allow the Affilae domains. See the Content-Security-Policy reference.

CSP configuration, server-side:

"default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://static.affilae.com/; img-src 'self' https://static.affilae.com/ https://lb.affilae.com/; frame-src 'self' https://lb.affilae.com/; connect-src https://lb.affilae.com/"

Install the tracking tag

This tag allows tracking of your partners clicks and their conversions.

Where to place it

  • On ALL pages of your website.
  • Inside the <head> section or just after <body>.

Code to install:

<script type="text/javascript">
var _ae = {
"pid":"YOUR_PROGRAM_ID",
};
(function() {
var element = document.createElement('script'); element.type = 'text/javascript'; element.async = true;
element.src = '//static.affilae.com/ae-v3.5.js';
var scr = document.getElementsByTagName('script')[0]; scr.parentNode.insertBefore(element, scr);
})();
</script>

Replace YOUR_PROGRAM_ID with your Program ID. You find it in your program Configuration, Tracking tab, Integration via an Affilae plugin section.

What this tag does

  • It detects when a visitor comes from an affiliate partner.
  • It protects against fake clicks.
  • It tracks the visitor journey.

Install the conversion tag

Where to place it

  • Only on the order confirmation page.
Good to know: to use this tag, the tracking tag must be implemented.

Code to install:

<script type="text/javascript">
var aeEvent = {};
aeEvent.key = 'RULE_KEY';
aeEvent.Conversion = {};
/* Values below must be updated */
aeEvent.Conversion.id = '{{ID}}';
aeEvent.Conversion.amount = '{{AMOUNT}}';
aeEvent.Conversion.payment = '{{PAYMENT}}';
aeEvent.Conversion.voucher = '{{VOUCHER_CODE}}';
aeEvent.Conversion.subid = '{{SUB_ID}}';
aeEvent.Conversion.customer = '{{CUSTOMER_ID}}';
aeEvent.Conversion.currency = '{{CURRENCY_CODE}}';
aeEvent.Conversion.product = '{{PRODUCT_ID}}'; // List of product_id separated by ;
if ('AeTracker' in window) {
AeTracker.sendConversion(aeEvent);
} else {
(window.AE = window.AE || []).push(aeEvent);
var c = aeEvent.Conversion;
new Image().src = 'https://lb.affilae.com/?key=' aeEvent.key
'&id=' c.id '&amount=' c.amount
'&cv=' (c.subid || '') '&payment=' (c.payment || '')
'&voucher=' (c.voucher || '') '&product=' (c.product || '')
'&customer=' (c.customer || '') '&currency=' (c.currency || '')
'&fp=&cids=&t=&source=js&v=fallback';
}
</script>

Parameters to be filled in

VARIABLE MANDATORY VALUE
KEY Yes The key is available in your program Configuration, Tracking tab, Integration via an Affilae plugin section. Example: 5f04fe700000000000000000-5f04fe700000000000000000
ID Yes Enter a unique identifier for this parameter. The simplest option is to use the order number. If you are using this code for newsletter subscriptions and do not have a unique identifier, we recommend using a hash (e.g. MD5) of the user e-mail address.
Amount Yes for the sales Total amount of the order EXCLUDING TAX, which will be used as the basis for calculating the commission and the revenue generated. Example: 123.45
Payment Yes, if the conversion is linked to a payment If conversions are subject to payment, specify the method chosen by your customer, otherwise leave this field blank: online for online payment, bankwire for payment by bank transfer, other for a completely different type of payment.
Customer Yes Please use an ID that will not change over time, preferably the ID number used in your database.
Cv No Custom variable that will be reported with the conversion and available in the interface and API. It allows you to assign your own ID to a conversion.
Voucher No Variable used to identify the promo code associated with a sale. The code is case sensitive. Use a semicolon as a separator to add multiple codes.
Product No List of product IDs, separated by a semicolon.

Your installation checklist

Before starting

  • I have my Affilae Program ID.
  • I have my conversion key.
  • I have configured the URL format in my dashboard.

Installation

  • Tracking tag installed on all pages.
  • Conversion tag installed on the confirmation page.
  • Variables replaced with dynamic values.
  • Test carried out with a test order.

Important checks

  • No personal data is transmitted.
  • Tags load correctly, to be checked in developer tools.
  • Conversions appear in my Affilae dashboard.
Tip: always test with a real transaction placed through a tracked link. An order created by hand in your back office does not fire the tag, so it proves nothing.

Related articles

Frequently asked
questions

Voir plus de questions reponses

Check that your Program ID and KEY are correct. Then check your security settings, in particular your CSP policy, which must allow the static.affilae.com and lb.affilae.com domains.

The tracking tag must be installed AND functional, so it must be tested first. Verify that all mandatory parameters are filled, then test with a real transaction through a tracked link.

Any personal data: no name, no surname, no e-mail address. To identify a customer, use a stable technical identifier, for example the one from your database.

Without tax. The Amount parameter expects the total order amount EXCLUDING TAX, and that value is the basis for calculating the commission and the revenue generated.

Separate them with a semicolon inside the same parameter. Note that promo codes are case sensitive.

In Affilae, open your program Configuration, then the Tracking tab. The Integration via an Affilae plugin section shows the Program ID and, for each rule, its Key.

Yes, but dedicated documentation exists and will save you time. See C2S – WooCommerce – Manual for a WooCommerce store, and C2S – GTM – Manual for an installation through Google Tag Manager.

Need help?

Stay up to date with the latest trends in affiliate marketing and never miss any of our articles.

Contact Us