Adding tracking code to page & cart

ocncommerce
New Member
1 0 0

I want to add some simple tracking javascript to my product pages and my cart pages. The software I'm using to track is called Clickmagick. These are the scripts.

For product pages:

<script>
    var clickmagick_cmc = {
        uid: '147533',
        hid: '2498782942',
        cmc_goal: 'a',
        cmc_ref: 'landingpageview',
     }
</script>
<script src='//cdn.clkmc.com/cmc.js'></script>
For cart page:
<script>
    var clickmagick_cmc = {
        uid: '147533',
        hid: '2498782942',
        cmc_goal: 'a',
        cmc_ref: 'atc',
     }
</script>
<script src='//cdn.clkmc.com/cmc.js'></script>
All that happens is the script fires when someone is on the page. But for the cart script for example, do I add it to cart.liquid? And where in the cart.liquid code is the best place to add this (in theory it should be one of the first things to fire after the page loads)? And where do I add it such that it propagates to all prod pages?
0 Likes