Hi All-
I am trying to get some pinterest tracking code setup and I need some help with some of the variables to put in, and how to put them in. CS-Cart v4.9.1
This code goes into the <head> of every page (I was planning on putting it in the Layouts so it's more easily editable, but when I try putting a variable in it's not translating so I am not sure if it's the location or what I am trying to use). What I need is in the red email address to fill in if the customer is logged into their account or once they enter in an email address at checkout. I tried $user_data.email but that didn't do anything except print that text out. I tried using {literal} around it but that trick didn't work either.
I need what is for '<user_email_address>'
<!-- Pinterest Tag --> <script> !function(e){if(!window.pintrk){window.pintrk = function () { window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var n=window.pintrk;n.queue=[],n.version="3.0";var t=document.createElement("script");t.async=!0,t.src=e;var r=document.getElementsByTagName("script")[0]; r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js"); pintrk('load', '########', {em: '<user_email_address>'}); pintrk('page'); pintrk('track', 'pagevisit'); </script> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?event=init&tid=#######&pd[em]=<hashed_email_address>&noscript=1" /> </noscript> <!-- end Pinterest Tag -->
And minimally, then I need the variables for these checkout actions too:
<script> pintrk('track', 'checkout', { value: 10.00, order_quantity: 2, currency: 'USD', product_ids: ['1414', '1415'] } ); </script> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=checkout&ed[value]=10.00&ed[order_quantity]=2&noscript=1" /> </noscript>
But would really love for it to output like this example:
<script> pintrk('track', 'checkout', { value: 116, order_quantity: 2, currency: 'USD', line_items: [ { product_name: 'Pillows (Set of 2)', product_id: '11', product_price: 48.00, product_quantity: 1 }, { product_name: 'Pillows, Large (Set of 2)', product_id: '15', product_price: 68.00, product_quantity: 1 }, ] }); </script>