Add the Pinterest tag to BigCommerce

It looks like you're viewing this from a region that Pinterest Tag isn't available in yet. See where Pinterest Tag is available to Pinterest Business accounts.

Learn more

BigCommerce is a platform you can use to create an online store. By connecting your BigCommerce store with your Pinterest tag, you can find out how much traffic Pinterest drives to your store and sales of your products

Add the base code

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.

  1. From your BigCommerce admin, click Storefront and then Script Manager.
  2. Click Create a Script.
  3. Fill out the form with the following info:
    • Enter Pinterest Base Code as the Name of script.
    • Enter Pinterest tracking tag as the Description.
    • Select Head for Location on page.
    • Select All pages for Select pages where script will be added.
    • Select Targeting; Advertising for Script category.
    • Select Script for Script type.
  4. Paste the code below into the Tracking Code box.
  5. Go to Ads Manager to get your unique tag ID. Click Ads, then Conversions and click Get started under Install Pinterest tag.
  6. Copy the 13 digit number below Tag ID and paste it in the Tracking Code box.
  7. Click Save.
<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: '%%GLOBAL_BillingEmail%%', });

pintrk('page');

</script>

Add the checkout event

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

 

  1. From your BigCommerce admin, click Advanced Settings and then Web Analytics.

  2. Click the box for Affiliate Conversion Tracking if it is not already clicked and then click> the Affiliate Conversion Tracking tab.

  3. Paste the following code in the Conversion Tracking Code box and replace YOUR_TAG_ID with your own tag ID from Ads Manager. If there's already code in this box, paste your tracking code after it.

  4. Click Save.

<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: '%%GLOBAL_BillingEmail%%', });

pintrk('page');

</script>



<script>

pintrk('track', 'checkout',{

value: %%ORDER_AMOUNT%%,

order_quantity:1,

order_id: %%ORDER_ID%%

});

</script>

Add the Add-to-cart Code (optional)

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.

  1. From your BigCommerce admin, click Storefront and then click Customize. Once Store Design opens, click Edit Theme Files on the left. If you need more information, see this BigCommerce help article.
  2. After opening the editor, find the products template code files. An example path is to go to Templates, then Components and then Products.
  3. Locate the file called addtocart.html and confirm that the file has an .html file type suffix.
  4. Open the addtocart.html file, find the code for add-to-cart submit button.
  5. Once you’ve found the code snippet for the button, copy the unique part of the code snippet.

  6. Go back to the BigCommerce editor and find the specific code within the file.

  7. Paste the following code after <input so that the add-to-cart event tag fires any time someone adds a product to their cart:

    onclick="pintrk('track', 'addtocart');"
  8. Click Save File at the bottom of the editor.

  9. After saving the file, navigate back to the custom theme you just edited in Store Design.

  10. Click the ellipsis icon and select Apply.

Still need help?
Contact us