Skip to main content

Using share a sale productfeeds

The shareasale network provides CSV (piped) formated datafeeds. Adding the feeds to the component could be very straightforward, unfortunately the share a sale feeds have some issue's:

  • they don't have a header row
  • the are zipped instead of gzipped ( must be windows people over their)
    • using ftp access the files are available gzipped
  • the feeds can not be downloaded (easily) automaticly.
  • the share a sale feed does not have your ID in the feed

all of these can be solved ( requiring datafeeds version 1035)

Shareasale.com Affiliate Software

Missing header row

The share a sale feeds have a fixed format and order of the fields, althought this is fine for a feed from a single network the CSV parser is created generic for all network, thus requiring a header row ( different for each network).

Zipped format

unlike the gzip format the zipped format is might not be integrated in your version of php . And php does not support a 'on the fly' parsing ( gzopen) of zipped files. Making the operation more memory savy

Automatic download

It is possible to request ftp download for datafeeds, however this requires approval of each merchant. Workaround is to use a CURL login and fetch script.

Manual fetch and parsing

Adding a parser

(this step is required once)

at the bottom of this page their is a link to download the share a sale parser. ( SVN:1035)

Put the contents of the script into /administrator/components/com_datafeeds/cron/xml_custom.inc

create the file if it doesn't exist. In the feed configuration (joomla administrator) you should see the 'Share a Sale' parser.

Adding your user ID

In the script just added you will find a function shareasale with the line

$item['href']=str_replace("YOURUSERID","435017",$item['href']);

replace the number. (there are a few reasons this is not in the parser and it is done this way, donate a few beers and we can chat about it)

Manual download

(this step is required each time you want to refresh the feed)

visit the share a sale website and download the datafeed. unzip the file an upload the resulting text file to your system. The location is not important, for example

merchantid.txt

After each download import ( cron ) the data into the component.

Feed configuration

(this step is required once)

In the feed configuration add a new feed, select the share a sale parser. In the feed url you can put a web-url pointing to the feed

https://[your website]/feeds/merchantid.txt

however it is far more efficient to use a file pointer

JOOMLA-ROOT/feeds/merchantid.txt

no clue where your JOOMLA-ROOT is? check the Global Configuration> system > path to log folder. This is mostly correct, replace logs by feeds/.txt and you got your path.

In the callback function replace the generic_cb by shareasale_cb

Fetching using ftp access

If a merchants grants ftp access to his datafeeds you can simply use the ftp path to fetch the data, for example feed url:

ftp://[your username]:[your password]@datafeeds.shareasale.com/11155/11155.txt

Automatic fetch and parsing using http access

Yes is is possible to use curl to fetch the feeds using http.

This is available on request and please make a donation before asking.