Affiliate and Traffic Tracking Codes
Aurora allows access to all the information required to add any tracking or affiliate code to its templates.
This article describes the two main methods of adding tracking codes for Affiliates or Traffic to the Aurora Front-end.
Managing/Adding Tracking Codes
Via the Aurora Back-end
This feature is being deprecated
Advantages: Easier access via the Back-end
Disadvantages: No version control (bad changes cannot simply be 'rolled back')
To enable the use of the Tracking manager in the Aurora Back-end under Store -> Tracking, the following must be added to the header and footer templates respectively.
In "_includes/header.tpl.html", place the following inside the "" tags at the location you would like all header tracking code to be found.
_includes/header.tpl.html
{$tracking.header}
In "_includes/footer.tpl.html", place the following just before the close "" tag.
_includes/footer.tpl.html
{$tracking.footer}
Once this is done, the Tracking Manager will then deal with the placement of all tracking code as configured in the Store > Tracking section of the Aurora Back-end.
Via the Front-end Templates
Advantages: Version control can be used (allowing simpler 'roll back' procedures in case of an error)
Disadvantages: Requires access via FTP
Code for all pages in the footer
Tracking code examples are typically stored in one of two places:
- The "checkout" template directory in files named "tracking-xyz.tpl.html" where the "xyz" is the name of the particular tracking system being managed.
- The "_includes/tracking/xyz/" template directory where the "xyz" is the name of the particular tracking system being managed.
Which of these locations used, is on the whole, down to when it was implemented and whether it requires application across all of the Aurora Front-end or just the Checkout.
When creating new codes, please consider using the newer "_includes/tracking/" directory to better contain a systems necessary files for all sections of the Aurora Front-end.
Please see an example of how this is done below:
checkout/tracking-xyz.tpl.html
<!-- REPLACE THIS WITH Your Tracking code to go on ALL pages -->
{if in_array("productdetails", $pageType)}
<!-- REPLACE THIS WITH Your Tracking code to go only on the Product Details page -->
{/if}
{if $tracking_order}
<!-- REPLACE THIS WITH Your Tracking code to go only on the Order Confirmation page -->
{/if}
These templates are then typically included in the footer template to be run on all pages to ensure code is distributed as needed.
_includes/footer.tpl.html
{include file="checkout/tracking-xyz.tpl.html"}
Code for specific pages in the footer
If you wish to include specific code on one particular page, but have this code appear in the footer, then you should consider something like this.
your/example/template.tpl.html
{capture assign="in_foot"}
<!-- REPLACE THIS WITH Your Tracking code to go only on THIS page -->
{/capture}
The "$in_foot" variable is normally already in place in the footer template (from the Aurora Demo examples), but can be added very simply as follows if not, enabling this behaviour for all Aurora Front-end Templates.
_includes/footer.tpl.html
{$in_foot}
A/B Testing Tracking Data
For more information on what A/B Testing is and how to use Aurora to do it, please see the A/B Testing using Merchandising Rules support article.
To track which Merchandising campaigns your customers are being exposed to, simply use the $merchandising_tracking_code variable in your Front-end Product Listing Templates when passing along information to your chosen 3rd party tracking provider.
Updated about 1 year ago