Shopify Tagging Instructions

Step One: Basic Tags
Add Rekko scripts to all pages of your website by inserting them into the theme’s head section of the theme.liquid file.
These tags are loaded by the web browser as visitors come to your website, and are used as tracking scripts/pixels to record visitor behavior and actions. These same tags also serve to deliver Rekko’s dynamic and intelligent content.
Copy & Paste the Basic Tags below into the head of your theme.liquid file
<script type=”text/javascript”>
var cvtSiteName = “YOUR SITE NAME“;
var cvtJsHost = ((“https:” == document.location.protocol)
                            ? “https://dnhgz729v27ca.cloudfront.net/” : “http://use.convertglobal.com/“);
document.write(unescape(“%3Cscript src='” + cvtJsHost
+ “client/setup.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
window.convert = new Convert(“YOUR SITE ID“);
convert.init();
</script><script type=”text/javascript”>
document.write(unescape(“%3Cscript src='” + cvtJsHost + cvtSiteName + “/extras.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
Step Two: Product Page Tagging
Add Rekko’s product page tagging scripts at the end of your product.liquid theme file.
Tagging your product pages with Rekko’s scripts will allow you to collect data to be used in features like Product Recommendations and Top Selling Products.
Copy & Paste the Product Page Tags below into your product.liquid file
<script type=”text/javascript”>
window.convert_productCode = “{{product.variants.first.sku}}”;
window.convert_productCategory = “{{ product.collections | map:’title’| join ‘,’ }}”;
</script>
Step Three: Cart Page Tagging
Add Rekko’s cart page tagging to the end of your cart.liquid theme file.
Shopping cart page tagging enables Rekko to collect transactional and e-commerce data for reporting, recommendations, and profiling. Unlike Web Analytics applications that may only tag the final Order Confirmation page, Rekko captures data from each stage of the transactional process. All data gathered from any stage of the transaction is stored in the individual’s visitor record which can be used to define Rekko Campaigns.
Copy & Paste the Shopping Cart Page Tags below into your cart.liquid file
<script type=”text/javascript”>
if(!window.convert_cart){
window.convert_cart={};
convert_cart.shoppingCartItems=new Array();
}
/*loop on items in the shopping cart*/
/*loop start*/
{% for item in cart.items %}
var convert_item={};
convert_item.sku=”{{ item.sku }}”;
convert_item.quantity = {{ item.quantity }};
convert_item.price=”{{ item.line_price | money }}”.replace(‘$’,”).replace(‘ ‘, ”);
convert_cart.shoppingCartItems.push(convert_item);
{% endfor %}
/*loop end*/
convert_cart.totalCost=”{{ cart.total_price | money }}”.replace(‘$’,”).replace(‘ ‘, ”);</script>
Step Four: Checkout Pages Tagging
Add Rekko’s Checkout page tagging to your order.liquid theme file.
Note that tagging includes visitor information for first and last name, as well as shopping cart information and purchased is true. Purchased is true should ONLY be tagged when the order is complete. All other tags should apply where information can be collected.

If your site uses a thank you page instead of the order.liquid template, you should add these scripts there under Settings -> Checkout which you can find in the Additional content and scripts section.

Copy & Paste the Checkout Pages Tags below into your order.liquid file
<script type=”text/javascript”>
if(!window.convert_profile){
window.convert_profile = {};
}
convert_profile.firstName = “{{ customer.first_name }}”;
convert_profile.lastName = “{{ customer.last_name }}”;
convert_profile.email = “{{ customer.email }}”;
</script>
<script type=”text/javascript”>
if(!window.convert_cart){
window.convert_cart={};
convert_cart.shoppingCartItems=new Array();
}
/*loop on items in the shopping cart*/
/*loop start*/
{% for item in order.line_items %}
var convert_item={};
convert_item.sku=”{{ item.sku }}”;
convert_item.quantity = {{ item.quantity }};
convert_item.price=”{{ item.line_price | money }}”.replace(‘$’,”).replace(‘ ‘, ”);
convert_cart.shoppingCartItems.push(convert_item);
{% endfor %}
/*loop end*/
if(Shopify && Shopify.checkout.total_price) {
convert_cart.totalCost = Shopify.checkout.total_price;
}
if(Shopify && Shopify.checkout.discount !=null){
convert_cart.promoCode = Shopify.checkout.discount.code;
}
convert_cart.orderId = “{{ order.order_number }}”;
convert_cart.isPurchased = true;</script>