Shopify

Add Besökskollen to your Shopify store via theme settings.

Difficulty: Easy

Takes about 5 minutes

Step 1: Open theme settings

  1. 1. Log in to your Shopify admin
  2. 2. Go to Online Store → Themes
  3. 3. Click Actions → Edit code on your active theme

Step 2: Edit theme.liquid

  1. 1. In the left menu, open Layout → theme.liquid
  2. docs.guides.shopify.step2.item2
  3. docs.guides.shopify.step2.item3
  <!-- Besökskollen tracking -->
  <script defer
    data-site-id="DIN-SAJT-ID"
    data-api="https://besokskollen.se"
    src="https://besokskollen.se/script.js">
  </script>
</head>

Step 3: Save

Click Save in the upper right corner. Done!

Track e-commerce events

To track specific e-commerce events like "Add to cart" or "Purchase completed", you can add event tracking in your Liquid templates:

Example: Track purchases on the thank you page

{% if first_time_accessed %}
<script>
  if (window.va) {
    window.va('event', 'Purchase', {
      orderId: '{{ order.id }}',
      total: {{ order.total_price | money_without_currency }},
      currency: '{{ order.currency }}'
    });
  }
</script>
{% endif %}

Tip

If you're using Shopify Plus, you can add the script via checkout.liquid to track the checkout process.