Jump to content

Adding Custom Code to "Add To Cart" Button

Recommended Posts

Site URL: https://www.blairmade.com/

I am attempting to integrate Pinterest conversion tags with my Squarespace site. I've gotten two of them working, but still struggling with the AddToCart event. I tried adding code into the header to fire when the "Add to Cart" button was visible, but it isn't finding the button, even when it is there. Does anyone have any tips with how they've been able to integrate this pinterest tag? I am sure I am just missing something obvious, so any help is greatly appreciated. TIA!


window.onload = function() {
  test = document.getElementById('yui_3_17_2_1_1595252067143_172')
  console.log("Printing " + test);


Link to comment
  • 2 months later...
  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply

I struggled with the same thing.  What I did was add the base code and event code under "Additional Info" in the product edit box.  If you add a code block and paste your base code and event code in that box, then when someone adds to cart the item, it should appear in the tag conversion.  Hope this helps! 

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.