Time to read: 10 min

The article covers the following topics:

Pixel-based tracking methods

When it comes to performance marketing, one of the biggest questions you can ask yourself (or your advertiser) is what kind of conversion tracking protocol you want to use: pixel tracking or postback tracking.

A pixel tracking is an HTML code snippet that is loaded when a user visits a website or opens an email. It is useful for tracking user behavior and conversions.

There are 4 main pixel-based tracking methods: iFrame, JavaScript, Image, and Adwords pixels.

Image

<!--Offer Conversion: offer_name -->
<img src="https://blabla2.bla2.com.com/success.jpg?offer_id=802" height="1" width="1" alt="" />
<!-- End Offer Conversion -->

Javascript

<!--Offer Conversion: offer name -->
<script language="JavaScript" type="text/javascript">var afoffer_id = 802;</script>
<script language="JavaScript" type="text/javascript" src="https://blabla2.com/track.js"></script>
<!-- End Offer Conversion -->

Iframe

<!--Offer Conversion: offer name -->
<iframe src="https://blabla2.com/success.php?offer_id=131802" height="1" width="1" />
<!-- End Offer Conversion -->

Adwords

<!--Offer Conversion: offer_name -->
<script language="JavaScript" type="text/javascript" src="https://demo.go2affise.com/gclid.js"></script>
<!-- End Offer Conversion -->

From an implementation perspective, all of the pixels work the same way.

Pixel tracking will place a cookie in the user's browser when a click occurred and will call back the cookie again on the conversion situation to authenticate the conversion. The system extracts the conversion information from that cookie and saves in Conversion Report.

How to set up pixel integration with your Affiliate?

In case you would like to proceed with a pixel integration with your affiliate, you can place their pixel manually in that affiliate’s settings (Affiliates section -> Affiliate Management section -> Find the needed affiliate -> Edit) or ask him to do it by himself from the affiliate panel (Offers section -> select needed offer -> Add pixel button):

To place an affiliate’s pixel manually, you should click at a dedicated button to add a new pixel and fill in the fields with the data such as determining offer, pixel code itself, type, and status of that pixel.

Where:

Moderation: set up as 'Approved' if you want this pixel code to work. 'Rejected' means you don't want this pixel code to work. 'Pending' means you're still thinking about letting the pixel code work.

Active: set up as 'Active' if you want this pixel to work right now. 'Not active' means the pixel code is not used in the integration process.

If the affiliate sets up the pixel code on his profile on Affiliate panel, the pixel will

appear in 'Pixel management' tab:

Once you make the pixel as 'Approved' or 'Rejected' in the Moderation column, it will disappear from this page. You can always change the 'status' of the pixel code on the affiliate edit page in the Admin panel.

❗ Once the affiliate adds the pixel code on his panel, it will be added to the list of his pixel codes on the affiliate edit page on the Admin panel automatically.

Here you can find available macro for affiliate’s pixel.

❗ If you are going to work with your affiliate by using a pixel, you have to integrate with your advertiser with a pixel (JS or IFrame pixel only). This only flow is possible because the affiliate pixel is triggered as soon as the Affise pixel is triggered. So to use the affiliate pixel you need to integrate with the advertiser with a pixel to be able to trigger it.

Affiliate pixel is sent for conversions of all statuses.

How to set up pixel integration with your Advertiser?

As for setting up your pixel integration with your advertiser, you should choose a desired pixel type in the Offers section -> Offer edit page -> Postbacks tab -> Integration pixels:

and provide your advertiser with it to let him implement it to the success page ('success page' is a page which a user will observe after completing the target action on an advertiser’s website).

It could be possible that you would like to implement some additional param to your pixel so your advertiser will pass extra data to you when the pixel is fired.

Here you can find available parameters for Advertiser's pixel.

Example of using an additional param for Image pixel:

<!--Offer Conversion: Offer -->
<img
src="https://tracking.go2affise.com/success.jpg?offer_id=802&afid={afid}&afprice={afprice}&afgoal={goal}&afua={useragent}&afcomment={comment}&afstatus=1&afsecure=ff87d311f555f103683dc49b6ff393a2&custom_field1={extra_data}&custom_field2={extra_data}" height="1" width="1" alt=""/>
<!-- End Offer Conversion -->

Example of using an additional param for JS pixel:

<!--Offer Conversion: Offer -->
<script language="JavaScript" type="text/javascript">var afoffer_id =802;
var afid={afid};
var afprice={afprice};
var afgoal={goal};
var afua={useragent};
var afcomment={comment};
var afstatus=1;
var afsecure=ff87d311f555f103683dc49b6ff393a2;
var custom_field1={extra_data};
var custom_field2={extra_data};
</script>
<script language="javaScript" type="text/javascript" src="https://tracking.go2affise.com/track.js"></script>
<!-- End Offer Conversion -->

Example of using an additional param for Iframe pixel:

<!--Offer Conversion: Offer -->
<iframe src="https://tracking.go2affise.com/success..php?offer_id=131&afid={afid}&afprice={afprice}&afgoal={goal}&afua={useragent}&afcomment={comment}&afstatus=1&afsecure=ff87d311f555f103683dc49b6ff393a2&custom_field1={extra_data}&custom_field2={extra_data}" height="1" width="1" />
<!-- End Offer Conversion -->

Example of using an additional param for Adwords pixel:

<!--Offer Conversion: offer_name -->
<script language="JavaScript" type="text/javascript">
var afid={afid};
var afprice={afprice};
var afgoal={goal};
var afua={useragent};
var afcomment={comment};
var afstatus=1;
var afsecure=ff87d311f555f103683dc49b6ff393a2;
var custom_field1={extra_data};
var custom_field2={extra_data};
</script>
<script language="JavaScript" type="text/javascript" src="https://tracking.go2affise.com/gclid.js"></script>
<!-- End Offer Conversion -->

❗ Advertiser's pixel is fired in status 'pending' ('2') by default. If you'd like to receive conversions in a certain status, use additional parameter 'afstatus=status' where 'status' should be replaced with a certain conversion status value. Ex. 'afstatus=1' for approved conversions. Conversions statuses and their values:

  • 1 – action is «approved» (paid by advertiser);

  • 2 – action is «pending» (decision in process, request status later);

  • 3 – action is «declined» (not paid by advertiser);

  • 5 - action is «approved» and put on Hold (will be paid by advertiser at a certain amount of time - the period of hold is taken from the offer settings).

If you have more than one goal in the offer, and you would like to track all goals, the pixel should be installed separately for each goal.

❗ We highly recommend using a secure (https) Tracking domain in any type of pixel. If http type of connection is used, always there is a chance of not recording of clickid in cookies, especially if the end-user uses Chrome 80 browser.

❗ Make sure you use the same tracking domain in Affise pixel and in Affise tracking link. This ensures the correct work of a cookie file and the whole integration.

Cookieless tracking for Advertisers

Pixel tracking is based on a cookie file integrated into the Affise tracking domain. From the browser's point of view, this cookie is a third-party one, because the Affise tracking domain isn't the same as the domain used for the offer. The browsers like Safari and Firefox don't support third-party cookie files, which makes the whole integration process impossible in some cases.

Affise offers the solution: direct pixel tracking, using the cookie file integrated into the offer's domain.

It is possible to use the JavaScript pixel only.

To get it, go to the Offers section -> a certain offer's settings -> the Postbacks tab. You see two codes:

Thus, there are two options for your workflow.

Scenario #1

The Affise tracking URL is used. The end-user sees it in the chain of redirects. JavaScript integration pixel is used.

Step 1. Add the clickid parameter and the {clickid} macro to an advertiser tracking link. In pixel integration, it is just a link to the offer landing page. You don't need to get the parameter for the click ID value from your advertiser.

Edit offer _ Eatbetter - Google Chrome 2022-09-16 at 12.11.56 PM

Step 2. The advertiser should allocate the following code on the offer's landing (target) page after the opening <body> tag:

<script language="javascript" type="text/javascript">function sc(v){let d=new Date();d.setTime(d.getTime()+(365*24*60*60*1000));document.cookie="affclick="+v+";"+"expires="+d.toUTCString()+";path=/";localStorage.setItem('affclick',v)}sc((new URLSearchParams(window.location.search)).get("clickid"))</script>

Step 3. The advertiser should allocate the following code on the offer's success (thank you) page:

<!--Offer Conversion: offer name -->
<script language="javascript" type="text/javascript">var afoffer_id = 144281;</script>
<script language="javascript" type="text/javascript" src="https://rocketcompany.g2afse.com/track.js"></script>
<!-- End Offer Conversion -->

How it works: the code on the landing (target) page extracts the click ID from the {clickid} macro and stores it in the cookie file saved in the local storage instead of the Affise tracking domain. Thus, the cookie file is saved not when redirecting to the Affise tracking link, but when reaching the offer's landing page. The third part doesn't participate here.

❗ Make sure the domain in the code for the landing and the code for the success page is the same. You can use either the default or the custom tracking domain.

Scenario #2

The Affise tracking URL isn't used. The click is initiated when the end-user is already on the offer's landing page. JavaScript (Direct) integration pixel is used.

Step 1. The advertiser should allocate the following code on the offer's landing (target) page after the opening <body> tag:

<script language="javascript" type="text/javascript">function cid(){var e;return Promise.resolve().then(function(){return null===(e=new URLSearchParams(window.location.search).get("pid"))?null:fetch("https://rocketcompany.g2afse.com/click?pid="+e+"&offer_id=1439361&format=json").then(function(e){return e.json()})})}function sc(e){var n=new Date;n.setTime(n.getTime()+31536e6),document.cookie="affclick="+e+";expires="+n.toUTCString()+";path=/",localStorage.setItem("affclick",e)}!function(){var n;Promise.resolve().then(function(){return cid()}).then(function(e){null!==(n=e)&&sc(n.clickid)})}();</script>

Step 2. The advertiser should put the &pid={pid} parameter to the URL of the landing page (to define an affiliate). As no Affise tracking link is used, determination of the affiliate is required on this stage.

Step 3. The advertiser should allocate the following code on the offer's success (thank you) page:

<!--Offer Conversion: offer name -->
<script language="javascript" type="text/javascript">var afoffer_id = 144281;</script>
<script language="javascript" type="text/javascript" src="https://rocketcompany.g2afse.com/track.js"></script>
<!-- End Offer Conversion -->

How it works: as no Affise tracking link is used, the system initiates the click by making a request right on the landing page. This request returns the click ID, saved in the local storage. This is why the JS code on the landing page is obligatory.

❗ Make sure the domain in the code for the landing and the code for the success page is the same. You can use either the default or the custom tracking domain.

The difference between these two scenarios is that the Affise tracking URL isn't used and the whole chain is shorter in the scenario #2. But in this scenario, passing the &pid={pid} parameter via the URL is required.

How to test pixel integration (Advertiser & Affiliate)?

It should be noted that an exact way the pixel has been fired by an advertiser and received by our server could be checked by navigating to Statistics -> Server postbacks.

❗ In case of Pixel integration, the IP of the end-user is shown in the 'IP' column in Server postbacks slice.

There are some common types of issues when receiving a pixel at Affise end.

1. Pixel received by Affise, but with an error “Missing mandatory parameter clickid/click_id or ref_id or aimp_id”:

Server postbacks _ Rocketcompany - Google Chrome 2022-04-25 at 4.06.51 PM

There can be the following reasons for such an error:

  • chain of redirects has not been initiated by Affise tracking link: the link generated on Affise should be used to reach to the success page;

  • redirection was carried out with incognito mode enabled;

  • the Advertiser's site does not properly support the actual pixel type;

  • the tracking link in pixel code does not match the one used to initiate the chain: check the domain that was used in the Affise tracking link and the one placed in pixel code. They should be the same;

  • HTTP Tracking domain is used instead of HTTPS.

2. Pixel received by Affise, but with an error “Access denied”:

Server postbacks _ Rocketcompany - Google Chrome 2022-04-25 at 3.54.34 PM

Reasons for such an error can be as follows:

  • Hash password has been generated on Affise but was not passed in the pixel by implementing a parameter &afsecure=secure_postback_code (where 'secure postback code' is a code set either on the offer's level or advertiser's level or platform level).

  • Hash password has been generated on Affise, it was passed in the pixel, but with mistakes (the password on Affise and passed password differ from each other).

  • Hash password is absent on Affise, but it was passed in the pixel via &afsecure= parameter.

3. Pixel received on Affise, but with an error "Access denied: wrong offer_id":

  • Once receiving a pixel with such an error message, the following situation has occurred: a user clicked on a tracking URL of Offer A (click information was saved in a cookie on Affise side) and reached the offer's landing page. After all, the same user opened Offer's B landing page without completing the whole redirection flow as in the 1st case and performed a target action ( a conversion). As a result, the conversion could have been recorded under Offer A. However, due to the 'offer_id' parameter validation you have in Affise pixel code, the system 'understands' that a click and a conversion have been performed for different offers. That's why an error message 'access denied: wrong offer_id' occurs.

  • If you see such a message, you can press on the data recorded in your postback logs under the 'postback parameters' column, find 'source' parameter and check from which landing page a conversion was made. This information will help you further with your investigation of why such conversion flow takes place for particular offers.

4. Pixel was not received on Affise. Reasons for it can be the following ones:

  • Pixel code was not implemented on the advertiser’s page.

  • There is some kind of error at the moment of pixel firing attempt.

How can you check Advertiser's pixel set up?

1. First of all, you should check if an Affise tracking link leads to the advertiser’s link directly. For such a thing you should add &format=json to your tracking link and put it into your browser address bar:

Ex: https://rocketcompany.g2afse.com/click?pid=2&offer_id=912&format=json

2. Proceed with all the steps to reach the success page where the pixel should be located. Meaning you should click at the Affise tracking link and then complete all the actions on the advertiser’s page, that should be done to reach the final page, where the pixel should be located.

3. When you are going to reach the success page, you should check the source code (crtl+U) to find out the pixel itself.

4. In case of success, you should observe a call-out record in your browser’s developer tools, as well as the cookie record with afclick value. If everything is going to be ok - > you should see a postback with status '1' response by navigating to Statistics -> Server postbacks in your Admin panel:

Server postbacks _ Rocketcompany - Google Chrome 2022-04-25 at 4.08.40 PM

Sometimes, the pixel should be fired, but you don’t see it in your server's post-backs tab. In such a case, you should check your ‘network’ tab in the developer tools and try to find a call-out attempt. You can find out that it’s going to be red. There you can see the exact reason for that call-out block. Like “blocked: mixed-content”, which should be related to the usage of http instead of https. For more information on Developer's Tool work, refer to the related article.

In case you can’t even find out an exact call-out attempt, an issue should be at the advertiser’s end.

FAQ

1) Can I use a postback integration with my affiliate in case I am integrated with my advertiser by pixel?

Yes, it is possible. If you're integrated with the advertiser via pixel, you can work with affiliates either with pixel or with S2S integration. However, if you integrate with the advertiser via Image pixel, you must integrate with the affiliate via postback only (S2S).

It works like that:

  1. The affiliate adds his postback link to the Affise platform.

  2. The advertiser adds the Affise pixel to his side (on the success page).

  3. The end-user makes the target action.

  4. The Affise pixel is triggered, and all the information from it can be passed via the affiliate's postback link to the affiliate.

There is a peculiarity:

If the affiliate would like to receive some information (like IP, UA, etc.) about the end-user, Affise Image pixel should contain &afstatus= and &afgoal= parameters. If there are no such parameters in a pixel, the affiliate will see the information about Affise servers, not about the end-user.

2) Can I use a postback integration with my advertiser in case I am integrated with my affiliate by pixel?

No. If you integrate with your affiliate by pixel, you have to integrate with your advertiser by pixel too. It works like that:

  1. The affiliate adds his pixel to the Affise platform.

  2. The advertiser adds the Affise pixel to his side (on the success page).

  3. The end-user makes the target action.

  4. The Affise pixel is triggered, and the affiliate's pixel is triggered automatically at the same time.

If the Affise pixel is not used, it's not possible to trigger the affiliate's one.

Moreover, in such a case, you should use JS or IFrame pixel just in any case (not Image). Otherwise, integration can be not stable. For example, you can receive a pixel from your advertiser, but an affiliate’s pixel will not be triggered.

3) Should I add any kind of param/macro to my pixel to pass/receive a clickid?

No, the pixel will pass your clickid right to an advertiser’s page by cookie, which will be generated upon the click at your tracking link.

4) There are a lot of broken pixels (without clickid) in the Server postbacks tab. How can I understand which of them is the one I am looking for?

All the pixels, even if they are broken, will have a source link in their description. By checking it, you can understand from what page this exact pixel is coming and even correlate it with that one in the offer’s tracking link field.

Server postbacks _ Rocketcompany - Google Chrome 2022-04-25 at 4.13.25 PM

5) I would like to check the redirections steps and to complete the goal to test the pixel, but for this, I have to proceed with payment. What should I do?

Well, there is nothing you can do in case you don’t want to spend your money. Just check the steps described above and ask a client to clarify it with his advertiser.

6) Which link should I use in the offer’s settings as a tracking URL, and should it be updated with parameters & macros?

You should use a direct link to your advertiser’s landing, which is located right before a success page. There is no actual need for some mandatory macros. Only in case, the advertiser would like to receive some extra data.

You may also find helpful the following Articles:


If you have more questions on Pixel Integration, feel free to contact the Affise Support Team via support@affise.com or your Dedicated Account Manager.

Did this answer your question?