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.

  • From your BigCommerce admin, click Storefront and then Script Manager.
  • Click Create a Script.
  • 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.
  • Paste the code below into the Tracking Code box.
  • Go to Ads Manager to get your unique tag ID. Click Ads, then Conversions and click Get started under Install Pinterest tag.
  • Copy the 13 digit number below Tag ID and paste it in the Tracking Code box.
  • 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.

     

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

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

  • 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.

  • 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.

  • 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.
  • After opening the editor, find the products template code files. An example path is to go to Templates, then Components and then Products.
  • Locate the file called addtocart.html and confirm that the file has an .html file type suffix.
  • Open the addtocart.html file, find the code for add-to-cart submit button.
  • Once you’ve found the code snippet for the button, copy the unique part of the code snippet.

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

  • 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');"
  • Click Save File at the bottom of the editor.

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

  • Click the ellipsis icon and select Apply.

  • End of Other articles Links
    Still need help? Contact us
    User feedback
    Was this article helpful?

    collection_fields

    How can we make this article better?