Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   More affliate id's for each network (/showthread.php?t=6063)

frme January 12th, 2012 06:30 AM

More affliate id's for each network
Hello everyone,

I've recently discovered after a lot of struggle, that it's not possible with the current version of Datafeedr to have more than 1 ID per affliate partner. See /showthread.php?p=27254

Yet, that is a big problem, seeing as i'd like to keep all my products in the same place, without having to create extra shops, subdomains, and so on.

Does anyone know another way to get around this problem - or does anyone have a ETA on when this will be implemented in datafeedr?


Eric January 12th, 2012 08:03 AM


The only way to get around this is to write a PHP function that can parse your affiliate links and insert the appropriate affiliate ID into the links based on the merchant. I would use this:

But after that is done, you will either have to write your own URL masking script or have unmasked affiliate links in your store.


Eric January 30th, 2012 08:57 AM

Here's how you can use a function to use 2 different IDs for the same network.

In your views where you have a "Buy" button, use the following HTML to link to the merchant's page:

HTML Code:

<a href="<?php echo dfr_url_sub($product); ?>" title="[]" target="_blank" rel="nofollow">[]</a>
Add the following function to your theme's functions.php file. Be sure to make the 2 substitutions as mentioned in the 2 comments.
PHP Code:

function dfr_url_sub($product) {
// Change to match your TradeDouble UK affiliate ID
$tradedoubler_uk_affiliate_id '12345';
// Change to match your TradeDouble Denmark affiliate ID
$tradedoubler_dk_affiliate_id '67890';
    if (
$product->net_id == 40) {
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_uk_affiliate_id$product->url);
    } else {
$url $product->url;

If your affiliate ID here The Factory > Your Store > Store menu > Affiliate ID's & Tracking Parameters > Tradedoubler is set to your UK ID, change it to your Denmark ID.

Now all of the URLs to the merchant's site will have the correct affiliate ID. The only downside is your affiliate URLs aren't cloaked.


frme January 31st, 2012 01:59 PM

Hello again Eric,

Once again thanks for the answers; it worked just fine for 2 ID's.
But what would i do in case i'd need to add more ID's for tradedoubler? (i.e. Germany, Sweden and so on). I tried adding them manually as the above, with extra lines, but it didn't seem to work.

Also - if i were to use other networks with this same setup, would i just add them to the same function too?


Eric January 31st, 2012 02:41 PM


These are the IDs for TradeDoubler Countries:

40 TradeDoubler UK
51 TradeDoubler Belgium
110 TradeDoubler Finland
64 TradeDoubler France
52 TradeDoubler Germany
111 TradeDoubler Ireland
66 TradeDoubler Italy
53 TradeDoubler Netherlands
65 TradeDoubler Spain
112 TradeDoubler Sweden
113 TradeDoubler Denmark

So a function like this is needed
PHP Code:

function dfr_url_sub($product) { 
// Add your affiliate IDs here
$tradedoubler_be_affiliate_id 'X'
$tradedoubler_dk_affiliate_id 'X'
$tradedoubler_fi_affiliate_id 'X'
$tradedoubler_fr_affiliate_id 'X'
$tradedoubler_de_affiliate_id 'X'
$tradedoubler_ir_affiliate_id 'X'
$tradedoubler_it_affiliate_id 'X'
$tradedoubler_nl_affiliate_id 'X'
$tradedoubler_es_affiliate_id 'X'
$tradedoubler_se_affiliate_id 'X'
$tradedoubler_uk_affiliate_id 'X'
    if (
$product->net_id == 40) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_uk_affiliate_id$product->url); 
    } elseif (
$product->net_id == 51) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_be_affiliate_id$product->url); 
    } elseif (
$product->net_id == 110) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_fi_affiliate_id$product->url); 
    } elseif (
$product->net_id == 64) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_fr_affiliate_id$product->url); 
    } elseif (
$product->net_id == 52) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_de_affiliate_id$product->url); 
    } elseif (
$product->net_id == 111) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_ir_affiliate_id$product->url); 
    } elseif (
$product->net_id == 66) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_it_affiliate_id$product->url); 
    } elseif (
$product->net_id == 53) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_nl_affiliate_id$product->url); 
    } elseif (
$product->net_id == 65) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_es_affiliate_id$product->url); 
    } elseif (
$product->net_id == 112) { 
$url str_replace($tradedoubler_dk_affiliate_id$tradedoubler_se_affiliate_id$product->url); 
    } else { 
$url $product->url


frme February 8th, 2012 09:25 AM


Thanks for the above once again. :)
Can you tell me where you find those Network id's (net_id)? In case i'd want to develop this further for other networks with multi-nationalities.

frme February 8th, 2012 09:47 AM

Never mind!

Figured out that if i hover the merchants inside the factory; the ID displays via the url. Seems to work at least. :)

stefan February 7th, 2013 06:26 AM

Now it's possible to add per store a different affiliate ID for each country within the same network.

That means you can now specify in Store > Affiliate IDs & Tracking Parameters a different affiliate ID for the different Tradedoubler countries.

All times are GMT -5. The time now is 12:55 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.