Pinterest conversion tags for Add to cart button

WizardofDeath
Tourist
12 0 1

Hi All,

I have written a script to track pinterest tags on product-form.liquid page

here is the script

<script>
function atcPin(){
pintrk('track', 'addtocart', {
value: '{{ product.price | money_without_currency }}',
currency:{{ shop.currency }},
line_items:
[
{
product_name: {{ product.title |json }},
variant_name: {{ variant.title | json }},
product_brand: {{ product.vendor | json }},
product_category: {{ product.type | json }},
product_id: "shopify_AU_{{ product.id}}_{{ variant.id }}",
product_price: {{ product.first_available_variant.price | money_without_currency }},
product_quantity: {{ variant.quantity | json }},
variant_id: {{ variant.id | json }}
}
],
});
}
</script>

 

here is the onclick event function call

<input type="submit" name="button" class="add pop-up-btn" onclick="atcPin()" value="{{ 'products.product.add_to_cart' | t }}">

Issue:

1. I cannot track the total quantity of product added on product page

2. need js script to change the variant price and variant name when user changes on product page

Reply 1 (1)

WeDoTheStuff
New Member
20 0 0

Hi @WizardofDeath,

 

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!