Shopify

From Growth Agency Wiki
Jump to navigation Jump to search

Tag Manager

Add Tag Manager to theme: Modify Theme

"online store" -> "..." or "Actions" -> "edit HTML / CSS"

Modify theme.liquid

Google Tag Manager will also need to be added to Checkout's additional settings to track conversions

Conversion Tracking Code

Google Tag Manager will also need to be added to Checkout's additional settings to track conversions

In "settings" -> "checkout" -> "additional settings"

{% if first_time_accessed %}
<script>
var dataLayer = window.dataLayer || [];
dataLayer.push({'order_id' : '{{ order_number }}', 'order_value' : '{{ total_price | money_without_currency }}', 'event' : 'order-submitted'});
</script>
{% endif %}

to add product ids add within the code above:

dataLayer.push({ 'product_ids' : [{% for line_item in line_items %}{{ line_item.product_id }}{% unless forloop.last == true %}, {% endunless %}{% endfor %}] });

Other

Shopify does provide you with the Product feed URL for your store. To access this, you will need to append .atom to either all of your collections or to a specific collection URL.

For example:

"yourstorename.com/collections/all.atom"
"yourstorename.com/collections/collectionname.atom"