Inserting the tracking code


To complete this process, you must have access to your website source code and be comfortable editing HTML (or have a webmaster/developer who can help you). The tracking code contains a unique ID that corresponds to your account. Don't mix up tracking code snippets from different accounts.


The tracking code is used by Yusp to collect event data on your site. It is, therefore crucial to include it on:
- all of your product pages
- pages where you plan to place recommender boxes
- on the "Checkout Complete" / "Thank you" page of your shop (if you plan to track buys as well)


blob1477667800738.png



To set up the tracking code:


  1. Copy the tracking code from the box including the <script> and </script> tags.
  2. Find the template file(s) of the page(s) that you want to track and paste the script between the <head> tags.

heaer_insert_tracking.jpg

Unless you really know what you’re doing, we advise you to paste the code snippet into all pages of your website. Here are the template files where you’ll want to paste the tracking code, if you’re using some of the most popular CMSs and eCommerce engines:


 

  • Wordpress (WooCommerce): We have a dedicated Woocommerce plugin, that connects your shop with your Yusp Dashboard and also handles seamless user and product catalog synchronization



  • Prestashop: (v. 1.6.1.6-0, might be different with earlier versions): themes/yourtheme/header.tpl - Note, that Prestashop does not recompile template files by default. If this is the case on your site as well, the Yusp installation guide will not let you proceed to the next step until you do one of the following: 
    • Delete the content of the following directories in your Prestashop folder...
      • /tools/smarty/cache
      • /tools/smarty/cache
      • /tools/smarty/compile
      • /tools/smarty_v2/cache
      • /tools/smarty_v2/compile
    • ...or go to "Advanced parameters -> Performance -> Smarty" on the Prestashop UI and check "Recompile templates if the files have been updated", for the time of the installation (if it is a production environment, set it back to "Never recompile", after you finish, as recompiling can make your site slower).
    • Stay tuned, as we're getting close to releasing our dedicated Prestashop plugin for Yusp.


  • OpenCart: (v. 2.2.0.0-1, might be different with earlier versions): catalog/view/theme/yourtheme/template/common/header.tpl


  • Shopify: If you're installing Yusp on a Shopify shop, please, use our Shopify plugin. For instructions on how to set up Yusp using the Shopify plugin, check out this page, or the plugin description in the Shopify store. 


  • Drupal 7: sites/all/themes/yourtheme/templates/html.tpl.php