Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (29 sloc) 1.02 KB
<!-- Custom Facebook Variant Remarketing Code -->
{% comment %}
Include this file at the bottom of your product page template.
{% endcomment %}
<script type="text/javascript">
$( document ).ready(function() {
if( fbq ) {
fbq("track", "ViewContent", {
content_name: "{{ product.title }}",
content_category: "{{ product.type }}",
value: {{ product.price | money_without_currency | remove: ',' }},
currency: "{{ shop.currency }}",
content_ids: [{{ product.selected_or_first_available_variant.id }}],
content_type: "product"
});
// Attache add to cart event
$( "#AddToCart" ).click(function() {
fbq("track", "AddToCart", {
content_name: "{{ product.title }}",
content_category: "{{ product.type }}",
value: {{ product.price | money_without_currency | remove: ',' }},
currency: "{{ shop.currency }}",
content_ids: [{{ product.selected_or_first_available_variant.id }}],
content_type: "product"
});
});
}
});
</script>
You can’t perform that action at this time.