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
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
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!
I'm having the same issue. That is, Pinterest instructions are as follows:
Step 3: Addtocart code
From your Shopify admin, click Online Store then Themes.
In the current theme you’re using, click Actions and Edit code.
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.
Search the file for addtocart by pressing and holding command+f on Mac or control+f on PC.
Place the following code within the ending caret of the <button> or <input> element
onclick="pintrk('track', 'addtocart');"
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
User | Count |
---|---|
25 | |
23 | |
22 | |
19 | |
13 |