Intercart Extension: Pinterest integration steps

  1. Go to Intercart > More > Integrations: Intercart Extension
  2. Click and view "Intercart Extension developer guides and samples"
  3. Check disclaimer "I have read Intercart Extension developer guides and understand the risks of Extension code."
  4. Click "Change"

   5. Replace YOUR_TAG_ID, paste code and click Save

!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','YOUR_TAG_ID');
pintrk('page');

itc.addEventHandler('Purchase', function(payload, additional) {
  pintrk('track', 'checkout',{
    value: additional.total,
    currency: additional.currency,
    order_quantity: payload.num_items,
    order_id: additional.transaction_id
  });
});

 6. Verify by placing a test checkout using Funnel > Preview


If you track Pinterest using Shopify Additional Script, the below is required. Otherwise, please ignore.

Shopify Additional Script: Add filters to prevent duplicate purchase tracking

  1.  Go to Shopify Settings > Checkout > Additional scripts

Replace "YOUR_TAG_ID" and paste code

{% if first_time_accessed %}
<script>
// check shopify order
let isIntercartOrder = false;
{% for tag in order.tags %}
  if ('{{ tag }}' === 'PoweredByIntercart') {
    isIntercartOrder = true;
  }
{% endfor %}

// execute when it is a shopify order
if (!isIntercartOrder) {
/* PINTEREST TRACKING CODE HERE - begin */

!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','YOUR_TAG_ID', { em: '{{ customer.email }}' });
pintrk('page');

pintrk('track', 'checkout',{
  value: {{ total_price | money_without_currency }},
  currency: '{{ currency }}',
  order_quantity: {{ checkout.line_item.quantity }},
  order_id: {{ checkout.id }}
});

/* PINTEREST TRACKING CODE HERE - end */
}

</script>
{% endif %}


Reference:
https://help.pinterest.com/en/business/article/shopify-and-pinterest-tag
https://help.shopify.com/en/themes/liquid/objects/checkout
https://support.intercart.io/en/articles/3298170-update-shopify-checkout-additional-script-to-prevent-duplicate-purchase-tracking

---

Did this answer your question?