Use the Pinterest for Shopify app to connect your Shopify store to your Pinterest business account.
You can only connect your Shopify store with one Pinterest business account at a time. If you have two Shopify stores, please
If you’ve already manually added the Pinterest tag to Shopify, or used a different third party to do so, we recommend that you
Before you can connect your Shopify store to your Pinterest account, you’ll need to:
Ideally, you should use a Chrome browser on your desktop to connect your Shopify store to your Pinterest account.
While it’s possible to manually add the Pinterest tag to Shopify, we do not recommend it. Where possible, follow the steps above to connect your store with the Pinterest for Shopify app so that your tag is added automatically.
The base code allows you to gather data on events, like someone buying a product or adding a product to their shopping basket. The base code must be installed across all pages of your website.
Scroll until you see </head> and paste this code above it:
<script type="text/javascript">
!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');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&noscript=1" />
</noscript>
After you install the base code, you can add different events to gather additional data. You can add the checkout event to track when people purchase a product and complete transactions.
Under Order Status Page Scripts, paste the following tracking code into the text box. If there's already code in this box, paste your tracking code after it:
{% if first_time_accessed %}
<script type="text/javascript">
!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');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&noscript=1" />
</noscript>
<script>
pintrk('track', 'checkout',{
value: {{ total_price }} / 100,
currency: '{{ currency }}',
order_quantity: 2,
event_id: '{{ event_id }}',
line_items: [
{
product_name: '{{ product_name_1 }}',
product_id: '{{ product_id_1 }}',
product_price: {{ product_price_1 }},
product_quantity: 1
},
{
product_name: '{{ product_name_2 }}',
product_id: '{{ product_id_2 }}',
product_price: {{ product_price_2 }},
product_quantity: 1
},
],
order_id: {{ checkout.order_id }}
});
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=checkout&noscript=1"/>
</noscript>
{% endif %}
After you install the base code, you can optionally add different events to gather additional data. You can add the addtocart event to track when people add products to their shopping carts.
Note: With some Shopify themes and widgets, you will not be able to add an addtocart event.
Place the following code within the ending
onclick="pintrk('track', 'addtocart');"
If you’ve already installed the Pinterest tag manually and now want to use the Pinterest for Shopify app instead, we recommend that you remove the manually-installed tag first, including the base code, checkout code, and addtocart code.
Scroll until you see </head> and find this code:
<script type="text/javascript">
!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');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&noscript=1" />
</noscript>
In the Order Status Page Scripts section, find the following tracking code in the text box. If there's more code in this box, make sure to only remove this part of the code:
{% if first_time_accessed %}
<script type="text/javascript">
!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');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&noscript=1" />
</noscript>
<script>
pintrk('track', 'checkout',{
value: {{ total_price | money_without_currency }},
currency: '{{ currency }}',
order_quantity: 1,
order_id: {{ checkout.id }}
});
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=checkout&noscript=1"/>
</noscript>
{% endif %}
Find and remove the following code. It should be at the ending caret of the <button> or <input> element:
onclick="pintrk('track', 'addtocart');"