Internet Marketing and Web Development Resources
Home Site Map About Contact

The Linkshare Merchandiser Service - Datafeed Access to Linkshare Feeds - Tips and Tricks

Table of Contents

The Linkshare Datafeeds and Datafeed Formats

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Thank you to Fernando Ibanez for providing all Linux how-to information and scripts, as well as MySQL scripts. Fernando's company is Exit 39, Inc., which provides product feed-related affiliate marketing widgets (beta).

Linkshare ("LS") has product feeds available in two formats: XML and PIPE delimited. The structure of the pipe delimited feed is available at the Network Specific Implementation Guides and Documentations/Linkshare Merchandiser Program/Resources section of this site. You can also find a list of the merchants that have datafeeds (linking to an Excel file at there.

- top -

Requesting Access to Datafeeds

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Most of the time, Linkshare's datafeeds are not enabled by default (even if you joined the merchant program) and require that you contact the LS Merchandiser Service Department to get the datafeeds enabled for your account.

The email address to contact them is (UK Affiliates, use this email instead: I think there is only one person at Linkshare US (and probably UK too) who takes care of such requests; I've always gotten a response from Kalia.

To make it easy for Linkshare to get the feed enabled, provide the merchant's MID (you can find the MID in the Excel file of the merchants that have feeds) and, if you happen to know it, your SID.

- top -

What is the Linkshare SID?

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Now, the SID is nothing that you can find in your online account. The SID is a unique key that identifies a specific "marketing channel" connected to your Linkshare login. You can have more than one marketing channel.

Also note that the FTP access is connected to a marketing channel. If you have multiple channels, multiple merchandiser FTP accounts will be necessary. If you don't know your SID, provide the LS Merchandiser Service Department with everything you do know or can find on the website that helps the department know what to enable:

  • The login used to log into the Linkshare website;
  • The marketing channel to which the FTP account is connected;1
  • The FTP user name/account for the merchandiser service department; and
  • The Linkshare affiliate link ID2 (which is also unique per marketing channel).

1 If you have multiple channels and don't know which one is enabled, make a list of each channel and connected programs that are approved for each channel and ask Linkshare as well.

2 The link ID is the 10-character value for the URL parameter "ID" in your affiliate links (

Take the opportunity to ask what your merchandiser-enabled SID is = Login/Marketing Channel = Link ID = FTP or Merchandiser Account.

You will also be able to see it once you have the FTP access working.

Just for the case they don't answer your question or if you forget it. You don't need to shoot them a separate email because of it.

- top -

Second Authorization

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Some programs require "second authorization." It's a flag in the merchandiser-enabled merchant's Excel sheet. This means that the LS Merchandiser Service Department cannot simply enable FTP access to the feed of an advertiser for you, even if you are already approved as an affiliate for the advertiser's program.

The advertiser wants to specifically approve/deny which affiliates can gain access to the feed. If your request requires second approval, the LS Merchandiser Service Department will send a request to the advertiser asking for permission.

That can take forever. I recommend sending the advertiser an email at the same time you request access to it from the LS Merchandiser Service Department, so that the advertiser knows what to look for on your behalf. You also get the chance to tell the merchant what you want to do with the feed and introduce yourself (if you have not yet had direct contact with the affiliate manager). This avoids or at least reduces the chance that your request for access will be denied.

Keep track of your requests, the dates you contact the LS Merchandiser Service Department, the dates you contact the merchant, and what the status of each request is. I created an Excel file and even sent it to the LS Merchandiser Service Department with every request as reference (so they can see what else is still pending somewhere in the process).

- top -

Sample Email to the Merchandiser Service

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Use your SID in the subject line of your email to the LS Merchandiser Service Department. For example:

Subject: New Feeds Request - SID: 666666 - MID: 926 - Office Depot

Hello Merchandiser Service (Kalia),

Please enable access to the Office Depot Datafeed (MID: 926).
Our SID is: 666666

Attached is the current status of all our LS datafeeds and datafeed requests.

Thank you,

Your Name and Contact Information

- top -

Providing Linkshare with YOUR IP address

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Part of the process of getting you up and running, using the FTP account of the LS Merchandiser Service Department, is to provide Linkshare with the IP address of the machine (server) that connects via FTP client to the Linkshare FTP server.

Crucial to this process is that you have a machine with a static IP address - that is, one that does not change. A dedicated or co-located server would be the best, or a DSL account where you pay a little bit extra to get a static IP address. Regular cable or DSL accounts usually do not have a static IP address and cannot be used (unless Linkshare does not mind changing your account over and over again when your IP changes). However, this will result in days during which you will have no access to fresh datafeeds.

I am not 100% sure, but I believe that Linkshare also allows the specification of an IP range (if it is not too broad). If that is the case, then you also need to provide what is called the "subnet mask." The subnet mask is always for a static IP; because it doesn't change with a static IP, nobody asks for it if a static IP address is provided. The subnet mask might be different if you provide a range of IPs.

Note 7/2007: I was doing a test from another computer with an IP address that was never registered with Linkshare. It was working, which means that Linkshare does currently not check the IP. This might change any day. Because of this, make sure that you do the steps correctly to avoid being blocked from accessing your feeds one day, if Linkshare actually checks the IP of incoming requests.

How to Find Your IP Address?

The best and safest way is to ask your hosting provider. Also ask for the subnet mask if your provider gives you an IP range instead of a single IP address.

If you can't ask the provider or if there is no provider and only a non-responsive IT department that leaves your server problems unaddressed, here is a way to find the IP of the machine you want to use for FTP access.

Is your server a Windows server? Select "start" and "run" and enter "cmd" into the textbox. Then hit enter. It should open a DOS Window with a blinking white prompt on a black background.

Type: "ipconfig" at the system command prompt. It should return the Windows IP configuration where you can see your IP address.

If your server has multiple network cards, a bunch of stuff will come back. If you are not sure which one is the one that actually connects to the Internet, you will need to contact your IT department.

If the IP address starts with "" you are within an internal network and probably behind a firewall as well. You will need to contact your department IT in that case.

How to Find Your IP Address in Linux

To find the IP of your host, you must use the command 'ifconfig'.
It is usually found in the /sbin directory. At the prompt type:

[admin@plain admin]$ /sbin/ifconfig

and you will get a response like:

eth0 Link encap:Ethernet HWaddr 00:C0:A8:FD:10:A9
inet addr: Bcast: Mask:
RX packets:105476284 errors:0 dropped:0 overruns:6 frame:0
TX packets:47008808 errors:0 dropped:0 overruns:0 carrier:0

The second line contains the desired information. (Here I have replaced the real values with fake information.)

inet addr: is your host's ip address i.e.
Bcast: is the Broadcast address i.e.
Mask: is the Net Mask for you host i.e.

Beware of Your ISP's Firewall!

This is usually not an issue with typical mainstream ISPs, but it can be a common issue if your server is located at a private entity, such as your company's data center.

The standard "port" used for FTP is "21", which is different from the regular web "http://" port, which is "80" or "443" for the "https://" secured transmission.

It is not uncommon that port 21 is by default blocked for incoming and/or outgoing traffic. If everything else seems to be set up correctly, and it still does not work, this might be the issue.

Your IT department needs to change the configuration of its firewall to "open the port" for traffic between the IP address of the Linkshare FTP server and your server where the FTP client is running.

You know your machine's IP, because you provided that information to Linkshare. Linkshare's IP is simple to find. Resolve the IP for the FTP address "". At the time I was writing this, the IP address was: (check current IP).

- top -

Simple FTP Access to Linkshare

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Download Under Windows

At this point, make sure that you have the FTP login and password for the Linkshare FTP and that Linkshare has enabled the IP address of the machine from which you are connecting to your FTP account.
If you do not have the login and password, or if the IP address has not been enabled, it will not work.

The FTP commands I am providing here will work for Windows servers, but might not work on Linux or Unix machines. Open a DOS Window again (explained in a previous section).

1) Enter "ftp" at the prompt, the DOS FTP client from Windows gets started which is also command prompt controlled.

2) Type "lcd" to set the local download directory on the server, example: "lcd c:\temp".

3) Connect to the Linkshare FTP, type: "open". It will prompt you to enter your username and password. Enter what was provided to you by Linkshare.

(When you enter the password, no characters are displayed on the screen, which might be a bit confusing.)

If you get disconnected at this point, either the username or password are incorrect or the IP from which you are connecting is not registered with Linkshare. You have to get that clarified first. Type: "quit" to exit the FTP client. Now it is time to get in contact with your IT department or ISP provider to find out which IP you are using, and if it matches what Linkshare has enabled for your account.

Continue If the FTP Login and Connection Were Successful

4) Type: "dir" to retrieve the list of files available on the FTP. It should return a list that looks similar to this:

-rw-rwxr-- 1 root 65533 0 Jul 30 04:08 926 666666 mp.txt.gz.lmp
-rw-rwxr-- 1 root 65533 0 Jul 30 04:08 926 666666 mp.xml.gz.lmp

926 is the MID of Office Depot which I use as an example. 666666 is your SID.
Two files should exist for each MID:

926 666666 mp.txt.gz.lmp
926 666666 mp.xml.gz.lmp

The ".txt.gz" is the feed in text, pipe delimited format and "xml.gz" is the feed in XML format. Ignore the fact that the files on the server are 0 byte in size and also ignore the extension ".lmp".

5) Write down the file names of the feeds you want to download.

6) Type: "binary"1

1This tells the FTP that you want to retrieve binary data. It is usually not necessary to enter, but it avoids possible issues and does not hurt.

Start the Downloads

7) Enter "get 926 666666 mp.txt.gz" or "get 926 666666 mp.xml.gz"

Replace 666666 with your SID and 926 with the MID of the merchant whose feed you want to download. Don't enter the ".lmp" extension.

The files should download and be saved in the folder you have specified earlier. Wait for the download to finish. The length of time it takes depends on the size of the feed and your connection speed.

Enter "quit" to leave the FTP client.

FTP Download in Linux

At the prompt, type:

[admin@plain admin]$ ftp
lcd /home/username
dir or ls
bi or binary
get filename

- top -

Automation of the Download

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Automation in Windows

This is a pretty cumbersome process to go through every time you want to get a new version of the file.

It can be scripted out via a simple BATCH file and a simple FTP script. Note that the script will have the username and password in it. Don't save it somewhere accessible by unauthorized users.

Create the SCRIPT File

1. Start "Notepad"
2. Paste the following lines into your new document:

lcd [local download directory]
[user name]
type binary
get [mid]_[sid]_mp.txt.gz

This example downloads the delimited text version of the feed. Replace the place holders enclosed by brackets with the appropriate values for your account/server/feed. It could look like this for example:

lcd c:\download
type binary
get 999_999999_mp.txt.gz

3. Save the SCRIPT as [name].txt such as "linkshare_merchant_999.txt". There is no risk of launching it by accident, because of the extension .TXT.

Create the BATCH File.

4. Start "Notepad" again
5. Paste the following lines into your new document:

ftp -s:[name].txt

such as

ftp -s:linkshare_merchant_999.txt

You might want to add the decompression of the downloaded feed file. Adding this to the BATCH file after the FTP is a good place for that.

If there is already an older feed file, Gzip would stop and ask if you would like to overwrite it. That is of course not so good if you automate it. You can add a line that deletes the extracted feed file, if it exists.

The BATCH file would look like this:

ftp -s:[name].txt
del filename.txt
gzip -d filename.txt.gz

6. Save the BATCH File as [name].bat such as "linkshare_merchant_999.bat" in the same directory where you saved the SCRIPT file already.

7. Double-click the BATCH file in Windows Explorer to start it. Done.

The BATCH file can be scheduled to run every day or so. A "task" could be created under Windows to do that. This is something your IT department can help you with, as well. (Type "task" in the "run" textbox and enter to open the Windows task scheduler application if you want to do it yourself.)

BATCH Download in Linux

The script you need to create is a shell script and pretty much like DOS batch files. The script automates downloads from the Linkshare FTP server.

It uses the program "wget" which is pretty much standard on every Linux install. You could use "ftp" just like you do in Windows, but for automation, wget is your best choice.

At the end of the script it uncompresses the files for you. I included a wget entry for each feed I want to download. Before you can run the script you can make sure your script is executable by doing:

[admin@plain admin] chmod +x download_script
chmod means "change mode", +x means add an executable flag to the file.
now to download all your feeds you can type this:
[admin@plain admin] ./download_script

The Script:

cd /path/to/linkshare/feeds
/usr/bin/wget -nv --dot-style=mega
/usr/bin/wget -nv --dot-style=mega
/usr/bin/wget -nv --dot-style=mega
gzip -d *txt.gz

- top -

Decompression of the Linkshare Datafeed Files

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Winzip is able to extract the .gz (Gzip) files. Gzip is a simple, command prompt controlled ZIP-like compression tool. Download Gzip for Windows. You need Gzip only if you want to compress files in .gz format, because Winzip does not do that.

- top -

Linkshare Datafeed SQL Import Script for MySQL Server

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

delete from tbl_merchant;
load data infile '/path/to/linkshare/feed/merchant_id_mp.txt' into table tbl_merchant fields terminated by '|'
lines terminated by '\n';
optimize table tbl_merchant;
select count(*) from tbl_merchant;

- top -

Linkshare Datafeed and General Affiliate Product Datafeed Resources

Return to Network Specific Implementation Guides and Documentations or Affiliate Marketing Resources Home

Other Data Feed Guides, Articles and Resources for Affiliates and Advertisers

- top - Sponsors

See the Advertiser Kit to learn more about sponsorship opportunities at Press? Download my Media Kit.

Email Alert & Newsletter (privacy) My Blog Posts and Newsletter (read)

Enter your email address:

or ReveNews - Carsten Cumbrowski - Feed