affiliate feeds commision junction

It is possible to use the datafeeds component to display the product feeds from commission junction using the CSV format. Versions 798 and newer support the gzipped format of the downloads. This website shows a few feeds. The cj feeds really lack some decent categories.

preperations

Username/password

CJ datafeeds require a password. Visit the services section in the CJ account manager. click the link Generate a new CJ HTTP password. You should recieve a username and password in your mailbox.

GZ compression

Commision Junction feeds are gz compressed. This is supported by the component however not enabled in older versions. To enable gz support add :

define('USE_GZOPEN',true);

to the callbacks file (feeds.php).

 

For each feed, click the Create Product Export' button

  • select CSV format , quoted (comma separated) or TAB will work fine.
  • select CJ HTTP
  • select a catalog
  • Save

 

You should receive a confirmation email. That one can be ignored. After some time ( might take hours) you should receive another email with the download link, like:

https:// datatransfer.cj.com/datatransfer/files/2862551/outgoing/productcatalog/41721/Killer_Dana-Killer_Dana_Product_Catalog.txt.gz

You need to add the username and email from the first mail :

https://USERNAME:PASSWORD@datatransfer.cj.com/datatransfer/files/2862551/outgoing/productcatalog/41721/Killer_Dana-Killer_Dana_Product_Catalog.txt.gz

 

The url goes into the feed url of the feed configuration. Use the CSV , and " parser. Click Apply and fill the field selections

 

CJ Semininairs

Commission Junction Offers Publisher Training including some seminairs about datafeeds. (17 & 18)

 

affiliate feeds commision junction

It is possible to use the datafeeds component to display the product feeds from commission junction using the CSV format. Versions 798 and newer support the gzipped format of the downloads. This website shows a few feeds. The cj feeds really lack some decent categories.

preperations

Username/password

CJ datafeeds require a password. Visit the services section in the CJ account manager. click the link Generate a new CJ HTTP password. You should recieve a username and password in your mailbox.

GZ compression

Commision Junction feeds are gz compressed. This is supported by the component however not enabled in older versions. To enable gz support add :

define('USE_GZOPEN',true);

to the callbacks file (feeds.php).

 

For each feed, click the Create Product Export' button

  • select CSV format , quoted (comma separated) or TAB will work fine.
  • select CJ HTTP
  • select a catalog
  • Save

 

You should receive a confirmation email. That one can be ignored. After some time ( might take hours) you should receive another email with the download link, like:

https:// datatransfer.cj.com/datatransfer/files/2862551/outgoing/productcatalog/41721/Killer_Dana-Killer_Dana_Product_Catalog.txt.gz

You need to add the username and email from the first mail :

https://USERNAME:PASSWORD@datatransfer.cj.com/datatransfer/files/2862551/outgoing/productcatalog/41721/Killer_Dana-Killer_Dana_Product_Catalog.txt.gz

 

The url goes into the feed url of the feed configuration. Use the CSV , and " parser. Click Apply and fill the field selections

 

CJ Semininairs

Commission Junction Offers Publisher Training including some seminairs about datafeeds. (17 & 18)

 

Framing the merchant pages

In general webshops do not allow cross origin iframes (anymore).

The ninja shadowbox (or lightbox) is a great extension to open images in a lightbox on your website. The ninja can be used to open iframed webpages as well. It is pretty easy to open merchant links in a lightbox on your site instead of clicking away from your site.

First install the ninja extension, in the module settings ensure the 'iframe' option is enabled.

Now you need to create a customized module or component layout

Simply add rel="shadowbox" or rel="shadowbox[list]" to the external links.

Customizing the component and module

CSS

the file .../components/com_datafeeds/assets/datafeeds.css contains the css used for the component and the module. Changing this file is not recommended the file is overwritten during every upgrade. Add any changes to your templates css. ( Where the css of your template reside depends on your template, for example .../templates/YOUR TEMPLATE/css/style.css )

Changing the layout's

template specific

Joomla provides a mechanism to change the layout for every component and module for a specific template: template override Simply copy

.../components/com_datafeeds/views/items/tmpl/default_LAYOUT.php

to

.../templates/YOUR TEMPLATE/html/com_datafeeds/items/

or

.../modules/mod_datamenu/tmpl/LAYOUT.php

to

.../templates/YOUR TEMPLATE/html/mod_datamenu/

and modify the copies file.

adding a custom module layout

In modules/mod_datamenu/tmpl copy a layout you want to modify; for example top5table_list.php to top5div_list.php. In the file change the name of the function to match the new file name, in this case Datatop5div_listMenu.

There are three flavours of module layout, based on the file name the dataitems array has different content:

  • for files ending with _list.php the dataitems is a  list of items based on the settings.
  • for files ending with _custom.php dataitems is empty
  • for all other files dataitems is a menu tree

Example

displays items almost like the component does

{include_code_listing /var/www/www.affiliatefeeds.nl/images/code/modascom-3073.txt}

adding a custom sub component layout

(svn 788)

simply copy an existing default_*.php file in .../components/com_datafeeds/views/items/tmpl/ ; for example to default_better.php, the new layout should appear in the drop downbox in the menu configuration.

 

adding a compleet component layout

Copy all files

.../components/com_datafeeds/views/items/tmpl/default*.php

to

.../components/com_datafeeds/views/items/tmpl/yourname*.php

and edit the files.

This method should  work for all joomla component. There is a specific change for this component:

in the file default.xml, copied to yourname.xml you will find base='default' (twice), change this to base='yourname'

 

 

Customizing the component and module

CSS

the file .../components/com_datafeeds/assets/datafeeds.css contains the css used for the component and the module. Changing this file is not recommended the file is overwritten during every upgrade. Add any changes to your templates css. ( Where the css of your template reside depends on your template, for example .../templates/YOUR TEMPLATE/css/style.css )

Changing the layout's

template specific

Joomla provides a mechanism to change the layout for every component and module for a specific template: template override Simply copy

.../components/com_datafeeds/views/items/tmpl/default_LAYOUT.php

to

.../templates/YOUR TEMPLATE/html/com_datafeeds/items/

or

.../modules/mod_datamenu/tmpl/LAYOUT.php

to

.../templates/YOUR TEMPLATE/html/mod_datamenu/

and modify the copies file.

adding a custom module layout

In modules/mod_datamenu/tmpl copy a layout you want to modify; for example top5table_list.php to top5div_list.php. In the file change the name of the function to match the new file name, in this case Datatop5div_listMenu.

There are three flavours of module layout, based on the file name the dataitems array has different content:

  • for files ending with _list.php the dataitems is a  list of items based on the settings.
  • for files ending with _custom.php dataitems is empty
  • for all other files dataitems is a menu tree

Example

displays items almost like the component does

{include_code_listing /var/www/www.affiliatefeeds.nl/images/code/modascom-3073.txt}

adding a custom sub component layout

(svn 788)

simply copy an existing default_*.php file in .../components/com_datafeeds/views/items/tmpl/ ; for example to default_better.php, the new layout should appear in the drop downbox in the menu configuration.

 

adding a compleet component layout

Copy all files

.../components/com_datafeeds/views/items/tmpl/default*.php

to

.../components/com_datafeeds/views/items/tmpl/yourname*.php

and edit the files.

This method should  work for all joomla component. There is a specific change for this component:

in the file default.xml, copied to yourname.xml you will find base='default' (twice), change this to base='yourname'

 

 

Setting the component language

The first version of the component addressed the Dutch affiliate market, therefor most text strings are still in Dutch. The component has an English language file but if your backend or frontend language is different you will see a lot of Dutch text. To change  the text to English (and your own language) do the following:

  1. Copy the file language/en-GB/en-GB.com_datafeeds.ini into the directory of your own language xx-YY/xx-YY.com_datafeeds.ini on the server.
  2. Put the file in  administrator/language/xx-YY as well

To translate:

  1. Translate the strings in xx-YY/xx-YY.com_datafeeds.ini
  2. Send the translated file to joomla@brambring.nl :)

Setting the string in the administrator to English is in progress 

Setting the front end strings

The strings and the currency sign used on the front end can/must be customised in the menu configuration. The picture below depicts the locations of the strings, on the front page and in the menu.

Read more: Setting the component language

Character encodings

 

Character encodings are a major issue when dealing with datafeeds. Quite often feeds are incorrectly encoded, feeds are encoded twice, older versions of PHP do not support UTF8 (multi-byte) correctly, same for old versions of mysql. In mysql the settings of the collation is important, for joomla this should be set to utf8.

Read more: Character encodings

Character encodings

 

Character encodings are a major issue when dealing with datafeeds. Quite often feeds are incorrectly encoded, feeds are encoded twice, older versions of PHP do not support UTF8 (multi-byte) correctly, same for old versions of mysql. In mysql the settings of the collation is important, for joomla this should be set to utf8.

Read more: Character encodings

Common problems

Many feeds have some kind of 'problems'. This pagee depicts some common issue's on solutions

Splitting Stuff

Many feeds have a complete tree in the 'category' instead of splitting their categories nicely for you. For example (from a tradedoubler CSV feed)

merchantcategoryname Donna > Scarpe > Derby

You can't assign this merchantcategoryname directly to Select1..Select3. The solution is using a callback function.

By default the callback function generic_cb is used. Instead of this function add and use a function splitting the category.

Read more: Common problems