Setting up a Pinterest Tag in the Addtocart code (Narrative Theme)

Max95
New Member
2 0 1

Hello Shopify Community!

 

I tried to setup the Pinterest Tag according to this Guide: https://help.pinterest.com/en/business/article/manually-add-shopify-tag I set up almost everything - however,  the last part "Step 3: Addtocard code" gives me a headache. I don't find any <button> or <input> element in “product.liquid”, or “product-template.liquid”, or “product-form.liquid” codes.

 

I have zero knowledge in coding, I just can copy and paste it somewhere. I am using the narrative theme with an active Ajax cart. I didn't find any help on YT or the Web since Pinterest changed up the code procedure a short time ago.

 

What I need to do is this:

"Under ‘Templates’ look for code files named “product.liquid”, or “product-template.liquid”, or “product-form.liquid” and open it. Note that this may vary depending on the theme you have installed, but it’s most common to see add to cart button code in the products.liquid file or equivalent."

then

"Place the following code within the ending caretof the <button> or <input> element:"

 

onclick="pintrk('track', 'addtocart');"

 

Please let me know where I should put this code, since I don't find the spot in the mentioned template codes.

 

Regards,

Max

Replies 6 (6)
Weddinginkshop
New Member
1 0 0

Hi Max95,

 

Did you by any chance receive an answer to this question? I am having the exact same issue.

 

Thank you!

Stacey

 

updatedones41
New Member
3 0 0

You need to find this line of code 

<button type="submit" name="add" id="AddToCart" class="btn product-single__cart-submit{% if section.settings.add_to_cart_width == 'full_width' %} btn--full{% endif %}{% if section.settings.enable_payment_button %} shopify-payment-btn btn--secondary{% endif %}" data-cart-url="{{ routes.cart_url }}"onclick="pintrk(etc..

and add it at the end before this>

 

This is correct and would love a double check .  Hope this steers us in the direction, in a direction.  Thanks.


@Max95 wrote:

Hello Shopify Community!

 

I tried to setup the Pinterest Tag according to this Guide: https://help.pinterest.com/en/business/article/manually-add-shopify-tag I set up almost everything - however,  the last part "Step 3: Addtocard code" gives me a headache. I don't find any <button> or <input> element in “product.liquid”, or “product-template.liquid”, or “product-form.liquid” codes.

 

I have zero knowledge in coding, I just can copy and paste it somewhere. I am using the narrative theme with an active Ajax cart. I didn't find any help on YT or the Web since Pinterest changed up the code procedure a short time ago.

 

What I need to do is this:

"Under ‘Templates’ look for code files named “product.liquid”, or “product-template.liquid”, or “product-form.liquid” and open it. Note that this may vary depending on the theme you have installed, but it’s most common to see add to cart button code in the products.liquid file or equivalent."

then

"Place the following code within the ending caretof the <button> or <input> element:"

 

onclick="pintrk('track', 'addtocart');"

 

Please let me know where I should put this code, since I don't find the spot in the mentioned template codes.

 

Regards,

Max


 

Paula2020
New Member
3 0 0

SOLUTION:

Note there is a pinterest app that is supposed to add the tag automatically. Suggest using that option first if it is available in your country. Instructions are in Pinterest.

https://help.pinterest.com/en/business/article/add-the-pinterest-tag-using-shopify 

MANUALLY:

I am using venture theme and I had product.template  file under Templates folder.

I was having the same problem that I didn't have the section of code that Pinterest said to go to nor as shown in updatedones41 thread. ( I did not have <input> nor <button>)

If you don't have the code that is specified by Pinterest in the file names suggested from your Template folder then check the Sections folder for one of the other file names e.g. product-template.liquid

I found product-template.liquid file under Sections folder and it had a line for <Input> and <button> however the Pinterest instructions are not detailed enough because it doesn't look like that simply.

The line starts with <button  BUT then followed by a bunch of stuff similar to shown in updatedones41 thread then ending with the  >. 

You can put the snippet  just before the >

When in doubt contact support!

rmeagher
New Member
1 0 0

I'm having the same issue. That is, Pinterest instructions are as follows:

Step 3: Addtocart code

  1. From your Shopify admin, click Online Store then Themes.

  2. In the current theme you’re using, click Actions and Edit code.

  3. Under Templates look for code files named product.liquid, or product-template.liquid, or product-form.liquid and open it. Note that this may vary depending on the theme you have installed, but it’s most common to see add to cart button code in the products.liquid file or equivalent.

  4. Search the file for addtocart by pressing and holding command+f on Mac or control+f on PC.

  5. Place the following code within the ending caret of the <button> or <input> element

    onclick="pintrk('track', 'addtocart');"

     

  6. Click Save in the top right corner.

 

Under Templates, I found product.liquid, but no <button> or <input> element. Under Sections I found product-template.liquid, but again there was no <button> or <input> element.

I am using the Debut theme in Shopify.

Any assistance would be most appreciated.

Sincerely,

Robert

Tasneem
New Member
2 0 0

Hi,

 

I too am facing the same issue. Did you find any solution?

WeDoTheStuff
New Member
20 0 0

Hi @Tasneem,

Our app will also fire the ATC events.

If you are having issues implementing your Pinterest pixel you can use our app.

A couple of clicks and you are good to go.

https://apps.shopify.com/pinterest-pixel-helper

Check it out!