Advanced Linking
The first part of this document is intended for affiliate publishers that need to create affiliate tracking to be added to raw links provided by the advance linking tools. This information is primarily for tech savvy partners who need to automate the creation of many links.
The second part of this document, "Using Affiliate Links Inside Apps," is intended for affiliates that need to create affiliate tracking links that will be implemented inside an app. The aim of this structure is to enhance the user experience on mobile devices. It will enable the user to go directly from an app to the iTunes Store or the App Store without first opening the web browser app. It is not recommended to use this method for website integrations as it limits reporting.
Note: The easiest and most direct way to create an affiliate tracking link is to use the Link Maker tool found inside your affiliate network's dashboard for the iTunes and App Store Affiliate Program.
|
Table of Contents
Adding Affiliate Tracking
Properly built affiliate links are essential for proper integration into the affiliate program. Adding affiliate tracking to raw iTunes links is necessary to fully use the advanced linking tools such as the Search API and the EPF, for linking to special pages inside iTunes and the App Store, and for working with links that deal with promotions.
The affiliate program relies on four separate affiliate networks for programs worldwide. Because each program has a proprietary methodology for building links, this document includes a section for each.
Reminder: LinkShare manages the affiliate programs for the United States and Canada, and LinkShare Japan manages the program for Japan. TradeDoubler manages the affiliate programs in Europe, while DGM Pro manages the Australia and New Zealand programs.
Affiliate Encoding for LinkShare
Following the steps below will allow you to create an affiliate link for the U.S., Canada, or Japan program. Before you begin, it is important to make sure you have been approved for these accounts and have access to them.
1. The easiest way to start building your affiliate links is to first get an example link to use as a guideline. You can do this by logging into your LinkShare dashboard and navigating to the Link Maker tool. Once there, make sure the country pop-up menu matches the affiliate program you just came through. Next, search for anything you like, click one of the results, and take the chunk of HTML that is given to you in step 3. It should look similar to this:
<a href="http://click.linksynergy.com/fs-bin/stat?id=CBIMl*gYY/8&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fjust-breathe%252Fid329520595%253Fi%253D329520674%2526uo%253D6%2526partnerId%253D30" target="itunes_store"><img height="15" width="61" alt="Pearl Jam - Backspacer - Just Breathe" src="http://ax.phobos.apple.com.edgesuite.net/images/badgeitunes61x15dark.gif" /></a>
2. From your chunk of HTML, grab the actual link in the HREF tag. For example:
http://click.linksynergy.com/fs-bin/stat?id=CBIMl*gYY/8&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fjust-breathe%252Fid329520595%253Fi%253D329520674%2526uo%253D6%2526partnerId%253D30
3. From the actual link, you now need to cut out the "wrapper." This is the part of the affiliate link that stays the same. This can be identified as everything in the beginning of link up through the RD_PARM1=. For example:
http://click.linksynergy.com/fs-bin/stat?id=CBIMl*gYY/8&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=
4. Take your new raw link (from an advanced linking tool or another place) and append partnerId=30 to the end. It is important to note how to attach this parameter. If no question mark is currently in the raw link, attach the partnerId=30 with a question mark. For example:
http://itunes.apple.com/us/album/achin-and-shakin/id363279843?partnerId=30
If the raw link already includes a question mark, attach the partnerId=30 with an ampersand. For example:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?i=359026563&id=355189623&s=143441&uo=4&patnerId=30
5. After attaching the partnerId to the link, you need to percent-encode it twice. The first example (with the question mark) should look like this:
http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fachin-and-shakin%252Fid363279843%253FpartnerId%253D30
6. Add your wrapper from step 3 to the beginning of your double-encoded affiliate link from step 5. This is your fully functioning affiliate link. For example:
http://click.linksynergy.com/fs-bin/stat?id=CBIMl*gYY/8&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fachin-and-shakin%252Fid363279843%253FpartnerId%253D30
This link is now a fully functioning affiliate link that is capable of tracking clicks, sales, and commissions through LinkShare.
Affiliate Encoding for TradeDoubler
TradeDoubler offers the iTunes and App Store Affiliate Program as separate programs in 14 different countries. You need to be accepted into at least one country to be able to link in Europe. If you need to link to several EU countries for which you don't yet have an affiliate account, you can enable this directly on the TradeDoubler portal (Settings -> Site Information -> My Countries).
To create an affiliate tracking link for TradeDoubler (Europe), you will need your program ID and website ID. These can be found on the TradeDoubler affiliate dashboard (Under "Settings" then "Site information").
| Program |
ISO 2 Code |
Program ID |
| iTunes AT |
AT |
24380 |
| iTunes BE |
BE |
24379 |
| iTunes CH |
CH |
24372 |
| iTunes DE |
DE |
23761 |
| iTunes DK |
DK |
24375 |
| iTunes ES |
ES |
24364 |
| iTunes FI |
FI |
24366 |
| iTunes FR |
FR |
23753 |
| iTunes GB |
GB |
23708 |
| iTunes IE |
IE |
24367 |
| iTunes IT |
IT |
24373 |
| iTunes NL |
NL |
24371 |
| iTunes NO |
NO |
24369 |
| iTunes SE |
SE |
23762 |
1. Add TradeDoubler tracking before the raw link. This part contains the program ID and your website ID and will be the same for all European affiliate tracking links. For example: http://clk.tradedoubler.com/click?p=(insert_program_ID)&a=(insert_website_ID)&url=ITUNES_URL
2. Add TradeDoubler tracking after the iTunes link. This part contains the partnerId=2003 parameter, a code that enables TradeDoubler to identify that this link belongs to an iTunes affiliate.
a. Check for a "?" in the iTunes link delivered by the API or EPF tool, which indicates that a query string already exists.
b. Attach the partnerId=2003 parameter using the correct separator character ("?" if there was none in the iTunes link or "&" if there is already a "?" in the iTunes link).
Correct tracking examples:
CORRECT: http://clk.tradedoubler.com/click?p=(insert_program_ID)&a=(insert_website_ID)&url=http://itunes.apple.com/pt/album/i-gotta-feeling/id317992994?i=317993054&partnerId=2003
CORRECT: http://clk.tradedoubler.com/click?p=(insert_program_ID)&a=(insert_website_ID)&url=http://itunes.apple.com/pt/album/id317992994?partnerId=2003
Incorrect tracking examples:
WRONG: http://clk.tradedoubler.com/click?p=(insert_program_ID)&a=(insert_website_ID)&url=http://itunes.apple.com/pt/album/i-gotta-feeling/id317992994?i=317993054?partnerId=2003 (The last question mark should be an ampersand.)
WRONG: http://clk.tradedoubler.com/click?p=(insert_program_ID)&a=(insert_website_ID)&url=http://itunes.apple.com/pt/album/id317992994&partnerId=2003 (The partnerId=2003 should be attached with a quesiton mark not an ampersand.)
3. It is strongly advised that you encode these links--from the raw link to the end--before you embed them.
Affiliate Encoding for DGM
Following these steps will allow you to create an affiliate link for the Australia or New Zealand program. Before you begin, it is important to make sure you have been approved for these accounts and have access to them.
1. The easiest way to start building your affiliate links is to first get an example. You can do this by logging into your DGM dashboard and navigating to the Link Maker tool. Once there, make sure the country pop-up menu matches the affiliate program you just came through. Next, search for anything you like, click one of the results, and take the chunk of HTML that is then given to you. It should look similar to this:
<a href="http://www.s2d6.com/x/?x=c&z=s&v=1530946&t=http%3A%2F%2Fitunes.apple.com%2Fau%2Falbum%2Fthe-fixer%2Fid327780123%3Fi%3D327780135%26uo%3D6%26partnerId%3D1002" target="itunes_store"><img height="15" width="61" alt="Pearl Jam - Backspacer - The Fixer" src="http://ax.phobos.apple.com.edgesuite.net/images/badgeitunes61x15dark.gif" /></a>
2. From your chunk of HTML, grab the actual link in the HREF tag. For example:
http://www.s2d6.com/x/?x=c&z=s&v=1530946&t=http%3A%2F%2Fitunes.apple.com%2Fau%2Falbum%2Fthe-fixer%2Fid327780123%3Fi%3D327780135%26uo%3D6%26partnerId%3D1002
3. From the actual link, you now need to cut out the "wrapper." This is the part of the affiliate link that stays the same. This can be identified as everything in the link up through the "t=". For example:
http://www.s2d6.com/x/?x=c&z=s&v=1530946&t=
4. Take your new raw link and append "partnerId=1002" to the end. It is important to note how to attach this parameter. If no question mark is currently in the raw link, you attach the partnerId=1002 with a question mark. For example:
http://itunes.apple.com/au/album/emperors-box/id365715063?partnerId=1002
If the raw link already includes a question mark, attach the "partnerId=1002" with an ampersand. For example:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?id=364115459&s=143460&partnerId=1002
5. After attaching the partnerId to the link you need to percent-encode it. The first example (with the question mark) should look like this:
http%3A%2F%2Fitunes.apple.com%2Fau%2Falbum%2Femperors-box%2Fid365715063%3FpartnerId%3D1002
6. Prepend your wrapper from step 3 with your double encoded affiliate link from step 5. This is your fully functioning affiliate link. For example:
http://www.s2d6.com/x/?x=c&z=s&v=1530946&t=http%3A%2F%2Fitunes.apple.com%2Fau%2Falbum%2Femperors-box%2Fid365715063%3FpartnerId%3D1002
Understanding Links
While understanding how to convert a raw link into an affiliate link is important to fully utilize the affiliate program, understanding how iTunes and App Store links are made will give you more flexibility in fully integrating the affiliate program into a site or an app.
There are two common types of deep links to specific items. These two types are "Clean" links, which were introduced in November of 2009, and "Legacy" WebObject links, which have been around since the inception of the store. Both types of links are supported in the store. Legacy links will continue to be supported indefinitely even though certain content is now referenced by the new Clean links.
Clean Links
Clean links are intended to give customers an indication of the content they see once they click a link. They are shorter and more user-friendly than the older style of links. A few examples of a clean link are:
http://itunes.apple.com/us/artist/blind-pilot/id284309952
http://itunes.apple.com/es/album/3-rounds-a-sound/id284309952?i=318683645
http://itunes.apple.com/fr/artist/plastic-bertrand/id78609223
Clean Links Deconstructed
Next, take a look at an example link, shown in its constituent parts. This is for U2's "Bullet the Blue Sky" on The Joshua Tree album:
http://itunes.apple.com/us/album/joshua-tree/id267826054?i=267826366
| Description |
Protocol |
Host |
Country Code |
Action |
Description |
Primary ID |
Query String |
| Example |
http:// |
itunes.apple.com |
/us |
/album |
/joshua-tree |
/id267826054 |
?i=267826366 |
| Notes |
|
|
[ISO-2A] |
|
Human-readable description |
No "=" sign |
Contains affiliate data and other information |
| Default Value |
|
|
us |
|
Optional |
|
|
In some cases, the descriptive portion of the link path is removed altogether, with the id directly following the action portion. For example: http://itunes.apple.com/us/album/id267826054?i=267826366.
Country Codes and Content Availability
If you are dealing with a link that does not have a country code (for example, most EPF links are not tied to a country), you should insert one that is appropriate for your users. The country code serves as a hint to the store. If the specific content is not available in the user's storefront, iTunes prompts the user to switch storefronts to view the requested content.
The country code also serves as a hint for the default language of the page requested when the user's preferred language is unknown. If no country code exists on the link, iTunes defaults to the U.S. storefront.
Legacy (WebObjects) Links
These links have been around since the inception of the iTunes Store, are still supported, and will be indefinitely. The preferred host for these links is now "itunes.apple.com," but "phobos.apple.com" links are also still supported.
Two examples of a Legacy link are:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=315611467&id=315611219&s=143441
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=954266
The Origin-Storefront Parameter
The "s," or "origin-storefront ID," parameter is the analog to the country code in the Clean Link format, and should be used similarly. "s," however, must be a storefront ID (such as 143441 for the United States or 143462 for Japan). A complete listing of countries and their storefront IDs is available in the appendix to this document.
Using Affiliate Links Inside Apps
The use of the affiliate program inside apps is perfectly acceptable and in fact encouraged behavior for app developers. It is important to note that because an app is not viewed in a browser in the way a website is viewed, the behavior of a regular affiliate link can be somewhat jarring. There are two ways to provide a better user experience--using short links or loading the affiliate link in the background.
Creating Short Links
A short link is a raw link that includes the two essential parameters necessary for tracking and commissioning. These are attached to the end of the link. This allows the link to still act as an affiliate link but does not first send the clicker of the link through the affiliate networks redirect. The links described earlier and in the Basic Linking document all send the user to a web proxy that the affiliate network uses to decode the affiliate link, increment any click tracking, attach any user level tracking, and perform other related activities. The Short Link avoids this step of the affiliate process but still allows the link to be affiliate commissionable.
By using a Short Link instead of a fully built affiliate enabled deep link (as described earlier), the site or app developer loses click tracking, as done by the affiliate network, but gains two things in exchange. These are faster resolution of the link and the avoidance of the need to open a web browser for the affiliate network's redirect to work on their proxy server.
The link resolves more quickly because a whole step is taken out of the process. The link goes straight to the iTunes Store or App Store instead of first going to the affiliate network and then being redirected to the appropriate store.
Using the standard affiliate link inside of an app, the app must first be closed, the Safari app then has to open for the redirect page to load, the Safari app then has to close, and the iTunes Store or App Store then loads for the specified item. This experience, called a stutter step, is not the ideal user experience expected inside an app. Instead, using a Short Link, the app closes, then the iTunes or App Store app opens immediately afterward, and the specific, requested item loads. Partners tend to be willing to give up click tracking and other related metrics associated with avoiding the redirect to enhance the user experience on a mobile device (iPhone, iPod touch, and iPad).
Creating a short link consists of adding two parameters to the end of your existing link. These two parameters are the partnerId and the affiliate token. The affiliate token is known differently depending on what affiliate network you are using. It is important to note that these parameters are case sensitive.
The partnerId either has a value of 30, 2003, or 1002, depending on the affiliate network with which you are working. This value specifies which affiliate network you are using.
| Affiliate Network |
partnerId |
| LinkShare |
30 |
| TradeDoubler |
2003 |
| DGM |
1002 |
The affiliate token parameter is slightly more complicated. The key and the value change depending on the affiliate network with which you are working. Where the partnerId specifies which affiliate network you are using, the affiliate token specifies your specific account inside the affiliate network.
LinkShare Affiliate Token
When using LinkShare, the affiliate token is siteID. This value is your 11-character encrypted ID that exists as the "id" value in any other LinkShare built link. The easiest way to find this value is to build a sample link using the Link Maker tool as defined in steps 1 and 2 earlier in the Affiliate Encoding for LinkShare section. For example, the siteID for an account that generated the following link would be: CBIMl*gYY/8.
http://click.linksynergy.com/fs-bin/stat?id=CBIMl*gYY/8&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fjust-breathe%252Fid329520595%253Fi%253D329520674%2526uo%253D6%2526partnerId%253D30
TradeDoubler Affiliate Token
If you are using TradeDoubler and wish to build a short link for a country in Europe, your affiliate token key would be "tduid." To get the value for your specific tduid, you first need to go to http://www.tradedoubler.com. Log in to your affiliate account. Click the "settings" tab on the menu on the left and then click "site information." Copy your program ID and website ID and send it to your local Affiliate Manager at itunesaffiliates@euro.apple.com in an email entitled "Affiliate Token."
DGM Affiliate Token
For DGM, the affiliate token is "affToken" and the value is your account ID. This numerical value can be found inside the DGM dashboard by choosing "Company Details" from the "My Details" pop-up menu on the dark blue navigation bar. The Affiliate Company ID is the number you are looking for.
Adding Parameters
Once again, it is very important to correctly add the two parameters (partnerId and the affiliate token) to the link correctly. Failure to do so could result in non-commissioning links. The first parameter added to a link always starts with a question mark. Sometimes the link (Clean or Legacy) will already include a parameter, so it is important to check for this first. If there is already a parameter added to the link, any following parameters need to be added with an ampersand.
Correct tracking examples:
CORRECT: http://itunes.apple.com/pt/album/i-gotta-feeling/id317992994?i=317993054&partnerId=2003&tduid=SuperAffiliate
CORRECT: http://itunes.apple.com/pt/album/id317992994?partnerId=2003&tduid=SuperAffiliate
Incorrect tracking examples:
WRONG: http://itunes.apple.com/pt/album/i-gotta-feeling/id317992994?i=317993054?partnerId=2003&tduid=SuperAffiliate
WRONG: http://itunes.apple.com/pt/album/id317992994&partnerId=2003&tduid=SuperAffiliate
Launching Redirect in Background
A second way to keep the use of an affiliate link inside an app from stutter step is by loading it in the background. This is a very technical workaround and requires a high understanding of software engineering. This method is described in the Apple Developer site under the iPhone OS Reference Library - https://developer.apple.com/iphone/library/qa/qa2008/qa1629.html.
Appendix: Country Codes and Storefront IDs
| Name |
Country Code |
Storefront ID |
| Algeria |
DZ |
143563 |
| Angola |
AO |
143564 |
| Anguilla |
AI |
143538 |
| Antigua & Barbuda |
AG |
143540 |
| Argentina |
AR |
143505 |
| Armenia |
AM |
143524 |
| Australia |
AU |
143460 |
| Austria |
AT |
143445 |
| Azerbaijan |
AZ |
143568 |
| Bahrain |
BH |
143559 |
| Bangladesh |
BD |
143490 |
| Barbados |
BB |
143541 |
| Belarus |
BY |
143565 |
| Belgium |
BE |
143446 |
| Belize |
BZ |
143555 |
| Bermuda |
BM |
143542 |
| Bolivia |
BO |
143556 |
| Botswana |
BW |
143525 |
| Brazil |
BR |
143503 |
| British Virgin Islands |
VG |
143543 |
| Brunei |
BN |
143560 |
| Bulgaria |
BG |
143526 |
| Canada |
CA |
143455 |
| Cayman Islands |
KY |
143544 |
| Chile |
CL |
143483 |
| China |
CN |
143465 |
| Colombia |
CO |
143501 |
| Costa Rica |
CR |
143495 |
| Cote D'Ivoire |
CI |
143527 |
| Croatia |
HR |
143494 |
| Cyprus |
CY |
143557 |
| Czech Republic |
CZ |
143489 |
| Denmark |
DK |
143458 |
| Dominica |
DM |
143545 |
| Dominican Rep. |
DO |
143508 |
| Ecuador |
EC |
143509 |
| Egypt |
EG |
143516 |
| El Salvador |
SV |
143506 |
| Estonia |
EE |
143518 |
| Finland |
FI |
143447 |
| France |
FR |
143442 |
| Germany |
DE |
143443 |
| Ghana |
GH |
143573 |
| Greece |
GR |
143448 |
| Grenada |
GD |
143546 |
| Guatemala |
GT |
143504 |
| Guyana |
GY |
143553 |
| Honduras |
HN |
143510 |
| Hong Kong |
HK |
143463 |
| Hungary |
HU |
143482 |
| Iceland |
IS |
143558 |
| India |
IN |
143467 |
| Indonesia |
ID |
143476 |
| Ireland |
IE |
143449 |
| Israel |
IL |
143491 |
| Italy |
IT |
143450 |
| Jamaica |
JM |
143511 |
| Japan |
JP |
143462 |
| Jordan |
JO |
143528 |
| Kazakstan |
KZ |
143517 |
| Kenya |
KE |
143529 |
| Korea, Republic Of |
KR |
143466 |
| Kuwait |
KW |
143493 |
| Latvia |
LV |
143519 |
| Lebanon |
LB |
143497 |
| Liechtenstein |
LI |
143522 |
| Lithuania |
LT |
143520 |
| Luxembourg |
LU |
143451 |
| Macau |
MO |
143515 |
| Macedonia |
MK |
143530 |
| Madagascar |
MG |
143531 |
| Malaysia |
MY |
143473 |
| Maldives |
MV |
143488 |
| Mali |
ML |
143532 |
| Malta |
MT |
143521 |
| Mauritius |
MU |
143533 |
| Mexico |
MX |
143468 |
| Moldova, Republic Of |
MD |
143523 |
| Montserrat |
MS |
143547 |
| Nepal |
NP |
143484 |
| Netherlands |
NL |
143452 |
| New Zealand |
NZ |
143461 |
| Nicaragua |
NI |
143512 |
| Niger |
NE |
143534 |
| Nigeria |
NG |
143561 |
| Norway |
NO |
143457 |
| Oman |
OM |
143562 |
| Pakistan |
PK |
143477 |
| Panama |
PA |
143485 |
| Paraguay |
PY |
143513 |
| Peru |
PE |
143507 |
| Philippines |
PH |
143474 |
| Poland |
PL |
143478 |
| Portugal |
PT |
143453 |
| Qatar |
QA |
143498 |
| Romania |
RO |
143487 |
| Russia |
RU |
143469 |
| Saudi Arabia |
SA |
143479 |
| Senegal |
SN |
143535 |
| Serbia |
RS |
143500 |
| Singapore |
SG |
143464 |
| Slovakia |
SK |
143496 |
| Slovenia |
SI |
143499 |
| South Africa |
ZA |
143472 |
| Spain |
ES |
143454 |
| Sri Lanka |
LK |
143486 |
| St. Kitts & Nevis |
KN |
143548 |
| St. Lucia |
LC |
143549 |
| St. Vincent & The Grenadines |
VC |
143550 |
| Suriname |
SR |
143554 |
| Sweden |
SE |
143456 |
| Switzerland |
CH |
143459 |
| Taiwan |
TW |
143470 |
| Tanzania |
TZ |
143572 |
| Thailand |
TH |
143475 |
| The Bahamas |
BS |
143539 |
| Trinidad & Tobago |
TT |
143551 |
| Tunisia |
TN |
143536 |
| Turkey |
TR |
143480 |
| Turks & Caicos |
TC |
143552 |
| Uganda |
UG |
143537 |
| UK |
GB |
143444 |
| Ukraine |
UA |
143492 |
| United Arab Emirates |
AE |
143481 |
| Uruguay |
UY |
143514 |
| USA |
US |
143441 |
| Uzbekistan |
UZ |
143566 |
| Venezuela |
VE |
143502 |
| Vietnam |
VN |
143471 |
| Yemen |
YE |
143571 |