Pinterest Addtocart event code

Solved
j_stan
New Member
1 0 0

Hi all!

 

I'm trying to set up Pinterest conversion tracking codes, so I just pasted a Pinterest base tag & Checkout Event to the theme.liquid file & checkout settings, however, I also want to add the Add To Cart event code, but I was not able to do it with the help of the official instructions since I couldn't find a line of code where I needed to pass the Add to Cart code. Can you tell me exactly where I should paste the code?

 

Instructions that I was looking at were these (Step 3) : 

https://help.pinterest.com/en/business/article/shopify-and-pinterest-tag

 

In my current code that I have in my product.liquid I couldn't find addtocart section where I need to input the Pinterest code. I talked to a support agent on chat and he pointed me out here.  FYI Im using the Brooklyn theme.

If there is more info you need let me know. Any help would be highly appreciated. Thanks!

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 185

This is an accepted solution.

Hey @j_stan,

 

Adapting their instructions to the Brooklyn theme, you can add the `onclick` attribute to the submit button (around line 311 of sections/product-template.liquid on a fresh theme).

 

<button type="submit" name="add"...

 

Would become:

 

<button onclick="pintrk('track', 'addtocart');" type="submit" name="add"...

 

 

AlexKptv
New Member
1 0 0

Hi. Same question, but for PageFly theme, please. Thank you.

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 185

@AlexKptv, please reach out to PageFly support.

0 Likes
Max95
New Member
2 0 1

Hey I have the same issue - I followed all steps on here: https://help.pinterest.com/en/business/article/manually-add-shopify-tag except the last one with the Addtocart Button. I am using the Narrative Theme and I cannot find the button anywhere. Please help me solve this!

Regards Max

0 Likes
davidezurigo
New Member
1 0 0

Hi all, 

 

same goes for me, I don't understand how to add the code for the "AddtoCart". I have the minimal theme - can someone help please?

 

Thanks,
David

 

0 Likes
cbfs
Tourist
3 0 1

I'm using the narrative theme as well, did you manage to solve it?

0 Likes
cyclists-com
New Member
1 0 0

Hi. Would be grateful to know how to add the pinterest tracking code in the product.liquid file;

 

In my theme the addtocart code looks like this;

 

var $addToCartForm = $('form[action="/cart/add"]');

 

The Pinterest code to add is onclick="pintrk('track', 'addtocart');"

 

I didn't want to break it but unsure how to add it correctly. Thanks

0 Likes
MathiasW
Tourist
7 0 1

I would appreciate help for Cascade theme. I also cannot find the addtocart. In product.liquid template there is an indication to look for section product.liquid, but there is nothing really. Would be good for Shopify to provide more support on integrating with Pinterest!

 

 

0 Likes
RSH
New Member
2 0 0

I've been working with Pinterest support and have not been able to get my add to cart code correct. I'm using the Shopify Theme Debut and placing the code on line 211 as their instructions:  data-add-to-cart onclick="pintrk('track', 'addtocart');"

 

The add to cart fires; however, it gives off 2 errors.

  1. No enhanced match was found 
  2. Value is missing

# 2 is an issue and will not allow me to proceed to be verified on the Pinterest platform.

0 Likes