A complete, Shopify-compatible, guide to setting up your Pinterest pixel to fire an event when a button is clicked. This is a really useful tool for marketers who are running lead generation campaigns! Disclaimer: You do not need to be a developer nor have any coding experience for this guide, as long as you can follow the steps carefully!
Disclaimer: You do not need to be a developer nor have any coding experience for this guide, as long as you follow the steps carefully!
The purpose of this is so you can set up something such as a "Lead" event to fire when someone submits a form on your website.
Important: If you have the Pinterest x Shopify app installed, the base code will be automatically inserted into your pages, so you can skip this step.
Firstly, you'll need to add the Pinterest base tag to the <head> section of your Shopify theme.
Here's the code:
Replace YOUR_PIXEL_ID with your Pinterest Tag ID.
In Shopify, go to your code editor.
Sales channels → Online Store → Themes → ••• → Edit Code
Navigate to the page that has the button you would like to track, ex: product.liquid.
Update your HTML button to include an ID:
If you did that all properly, your final code should look something like this for a Shopify section:
If you're not adding this to Shopify your code would look something like this:
Open your site, click the button, open Pinterest, and confirm your Lead event has fired!
Note that working in an incognito window (command+shift+n) is recommended to make sure you're not being impacted by cache.
Be sure to always refresh your pages and even hard reload them (command+shift+r) when testing.
If you encounter issues, here are some steps to troubleshoot:
You can inspect the HTML element to ensure that the "button_track" ID is is correctly placed. Right-click on the button → Inspect
Use the Pinterest Tag Helper Google Chrome extension to confirm that the pixel fires on the page. The base pixel needs to be present on your page for the button click to properly track.
Alright, if you've made it this far, you've done it. You've cracked the code on setting up a Pinterest "lead" event on your website or Shopify store. From here on out, you'll be gathering data that's actually useful, and not just generic page views. So go ahead, take that overdue sip of coffee, or maybe something stronger.