Censura Support

Affiliate Link Templates

Censura has the ability to create affiliate link templates which can be applied to all products in a category, or to products on an individual basis. These templates can use values from the product itself or even retailer-specific values for a particular product which you can set on a retailer/product basis.

Built-in Retailers & Templates

Censura 2.2 ships with basic built-in templates for Amazon and Google Adsense. We've done our best to make sure these will work straight out of the box, but from time to time you might need to check them against the code that they provide you with. These templates are provided as well to give you an idea of how the templates work. If you want to use these templates, set your affiliate id (Amazon tag or Google publisher number) in the form at "Admin > Retailers > (retailer) > Edit". Then assign them to pages as decribed below (AffiliateLinkTemplates#ShowingLinksontheProduct_Page).

Create a Retailer

If you want to create custom templates, first you need to create a retailer. Broadly, this is the company or institution which provides the affiliate scheme, eg, Google, Amazon, eBay, Dave's Widgets or whoever. You have the opportunity to upload a logo and set an affiliate ID. You can optionally define an affiliate ID here if you were given such an ID, then refer to it from your templates, to prevent repetition of the ID throughout the templates (eg if it changes, you can change it in one place). You can also do the same with coloiurs, you can define up to 5 colours here then use them in your templates.

Create a Template

Next you need to create a template. In the retailer template index (which you should arrive at after adding a retailer, if not click "templates" next to the retailer in the retailer list), click "create a template".

Next you will be asked to select a type. If your affiliate link is a simple link, for instance:

<a href="http://www.censura.info/referral/my_affiliate_id">Get Censura!</a>

Select the "Simple Link" option. You will be asked to enter the link URL and content separately... this way Censura can count clicks for you. If your link is more complicated, for example:

<script type="text/javascript" src="http://www.censura.info/js/affiliate_scheme.js"></script>

... or a flash banner, or something similar which can't be broken down into a simple a element, use the "HTML Code" option.

Next you will be presented with a form, enter the name of the template to differentiate it from other templates for that retailer. The fields that come after this are all template fields, where you can enter a template to be evaluated by the product it is assigned to.

General Template Usage

In these boxes You can use template variables in that can retrieve information about the product the template is assigned to, eg:

{$product->name} //(the name of the product) {$product->id} //(the product's id in censura) {$product->attribute_var_name} //(the value of an attribute assigned to the product, where attribute_var_name is the "var name" you gave the attribute on the attribute creation form) {$product->vendor->name} //the product's primary vendor {$product->category->name} //the product's primary category

We have also added Amazon ASIN in 2.2, if the product was created by the amazon importer

{$product->asin}

...although you can override this by creating an "asin" attribute (it will check first for the attribute, then look for one set by the importer).

You can also use information about the retailer:

{$retailer->name} //the retailer's name eg amazon {$retailer->affiliateid} //the retailer affiliate id you set when creating the retailer {$retailer->colour1} //colours defined when creating the retailer (please note the correct spelling of colour :) ) //etc up to colour5 ...

Or even the user, should you so wish:

{$_user->username}

Sometimes however, you need to use information which is specfic to that product and that retailer, for example, the retailer's stock keeping unit (SKU), or the id of the item on their website (for example, the ASIN for Amazon). In this case, you can use an additional variable, eg:

{$asin}

...Censura will recognise that it is not one of the standard variables described above, so will view it as being specfic to that product-retailer pairing. When you assign the template to a product or category, there will be a form in the administration section for each product it is assigned to where you can set the value of these custom variables. In this case you would go to a product this template was assigned to, click edit affiliate templates, select edit values, then you could enter an ASIN. The template is standard smarty, so you can also use functions and modifiers that it provides, for example:

{$product->name|capitaize}

See the smarty documentation for more information.

Creating a Template

Back to the create a template form, you now have several template fields: Condition - this determines whether the link should be active for a given product. A good way to use this would be to check that an SKU had been entered for a product before showing the link, then you could assign it to a category and it wuld only be shown for the products for which you had entered an SKU value, eg:

$sku

Would evaluate in smarty to:

{if $sku} //show link {/if}

You can also combine criteria, see the smarty documentation URL template - simple link only - if you selected simple link, enter the link template here. For example: http://www.amazon.com/asin/{$asin}/tag/{$retailer->affiliateid} or something like http://www.amazon.com/search?q={$product->name|escape:'url'}&tag={$retailer->affiliateid} which could be shown for all products without needing to enter an ASIN. You could then enter an $asin value for each product, and it would be replaced into this template. Link contents template - simple link only - enter the link contents here, so it could be text or an image, eg: {$product->name} or {$product->name} HTML Code Template - html code only - if you selected html code enter the code given to you by your provider here. Remember you can still replace product-specific parts of the code with template variables in exactly the same way as with a simple link:

Showing Links on the Product Page

Templates can be assigned to the root category to show them on all pages, to a specific category, or to a specific product. Assign templates to a category by going to "Admin > Categories > (select a category) > Edit Affiliate Link Templates" then assigning the template. Assign templates to a product by browsing to the product, and selecting "Edit Affiliate Link Templates" from the menu.

Slots

When assigning templates, you will be asked which "slot" you would like to show the template in. Slots are predefined positions on the product page where you can show affiliate links. Click the preview button to see where slots are on the product page. Generally "simple link" type templates will go in the "availablefrom" slot, and other banners etc can go in the other slots around the page. Most slots will show all the templates assigned to it in rotation. The "availablefrom" slot is different in that it will show all links assigned in a list, and also show the retailer's logo.

Activating templates

When you assign a template to a category, it may not necessarily show for a particular product, especially if the template has a condition. Browse to the product you want and select "Edit Affiliate Link Templates". Here you will see the assigned templates, wplit into ones which are currently showing (at the top in green) and templates which are inactive (underneath in red). There will be a status next to the inactive templates letting you know how you can activate them, usually by editing it's variables. For instance, for the Amazon templates, you have to set an affiliate id (your tracking tag given to you by Amazon) and an ASIN (amazon's id for an item) before it will show for a particular product. Set the {$retailer->affiliateid} from the retailer form (Admin > Retailers > Amazon > Edit). Then click the edit button next to the template for the product and set the ASIN, then it should show (presuming you have already set your affiliate tag from the retailer menu). If you imported the product using the amazon importer, the ASIN will already have been set for you, so you just need to set your affiliate id to activate the link. Similarly for the built-in Google templates, you just need to set your affiliate id in the retailer form to activate the templates. Enter your publisher number and the template will activate on all products to which it has been assigned.

Deactivating templates

You can also explicitly remove a template from a product even though it is assigned to it's category. Click the remove link next to the template from the product affiliate link menu.

Statistics

From the product template page you can also view statistics for a given template on the given product page. Click "Stats" and it will tell you how many times that template has been shown for this product in each month/year. If it's a "simple link" type template it will also count the clicks and click through rate for you as well.

Advanced

You can also create your own slots if you are editing your template. Just add:

{affiliate_link_slot product=$product name="slot_name" mode=rotate}

...to the position you want to show the link slot, where slotname is the name you want to give the slot (a-z,0-9, or - only please). You can either set mode=rotate (show only one template at random from all the templates assigned to this slot)or mode=all (show a list of all templates assigned, one after the other). Then, in "Admin > Config > Affiliate Links" add the name(s) of the slot(s) you have just added to your template. You can now assign templates to these slots.



Email newsletter sign up

Sign up to the Censura email newsletter to be kept informed of the latest developments with Censura