Arktis.

Tracker Script

Configure the tracking script, track custom events, and identify users.

Installation

Add the tracking script to your website, just before the closing </head> tag.

HTML
<script
  src="https://arktis.so/arktis.js"
  data-site-id="YOUR_SITE_ID"
  async
></script>

Configuration Options

Configure the tracker using data-* attributes on the script tag.

AttributeTypeDescription
data-site-idstringRequired. Your unique site identifier.
data-debugbooleanShow debug overlay. Default: false
data-respect-gpcbooleanHonour the visitor's Global Privacy Control signal. Default: true
async-Recommended. Load script asynchronously.

Track Custom Events

Use arktis.track() to track custom events with optional properties.

JavaScript
// Track a custom event
arktis.track('button_click', {
  button_id: 'signup-cta',
  location: 'hero'
});

E-commerce Example

JavaScript
// Track a purchase
arktis.track('purchase', {
  order_id: '12345',
  total: 99.99,
  currency: 'USD',
  items: ['product-1', 'product-2']
});

Common Events

  • button_click - User clicked a button
  • form_submit - Form was submitted
  • signup - User signed up
  • login - User logged in
  • purchase - Purchase completed
  • add_to_cart - Item added to cart

Identify Users

Connect anonymous sessions to known users when they sign up or log in using arktis.identify().

JavaScript
// Identify a user after login
arktis.identify('user@example.com', {
  name: 'John Doe',
  plan: 'pro',
  created_at: '2024-01-15'
});

The first argument should be a unique identifier (usually email). Additional properties are optional.

Track Conversions

Use arktis.convert() to track goal completions and conversions.

JavaScript
// Track a conversion
arktis.convert('signup');

// Track a conversion with value
arktis.convert('purchase', 99.99);

Parameters

  • goalName - Name of the conversion goal (e.g., "signup", "purchase")
  • value - Optional. Monetary value of the conversion

Common Conversion Goals

  • signup - User registered an account
  • purchase - User completed a purchase
  • trial_start - User started a free trial
  • subscription - User subscribed to a plan
  • lead - User submitted a lead form

Debug Mode

Enable debug mode to see a real-time overlay of tracked events on your site.

Via Script Attribute

HTML
<script
  src="https://arktis.so/arktis.js"
  data-site-id="YOUR_SITE_ID"
  data-debug="true"
  async
></script>

Via Console

You can also enable debug mode from the browser console:

JavaScript
// Enable debug mode programmatically
arktis.debug();

Privacy & Consent

Arktis is designed with privacy in mind. The tracker does not use third-party cookies and respects user consent.

Conditional Tracking

Only track events if the user has given consent:

JavaScript
// Only track if user consents
if (userHasConsented) {
  arktis.track('form_submit', { form_id: 'contact' });
}

Global Privacy Control

When a visitor's browser sends Global Privacy Control, Arktis still counts the visit and its source, but with an identifier that lasts only for the browser session. It sets no cookies, removes identifiers left by earlier visits, never records the session, and does not attach an email from identify(). A plain arktis.consent() call, including one made automatically by a cookie banner, is ignored. This is on by default; set data-respect-gpc="false" to turn it off.

If the visitor explicitly opts in after you tell them it conflicts with their browser setting, pass overrideGpc. The opt-in is remembered until arktis.revokeConsent() is called.

JavaScript
// The visitor's browser sends Global Privacy Control, and they have
// explicitly opted in anyway after you showed them the conflict.
if (arktis.gpcActive() && visitorConfirmedOptIn) {
  arktis.consent({ overrideGpc: true });
}

Data Collection

Arktis collects the following data:

  • Page URL and title
  • Referrer URL
  • Browser and device type
  • UTM parameters
  • Custom events you track
  • User identifiers you provide via identify()

Shopify Integration

Arktis automatically tracks product views, add-to-cart clicks, and cart views on Shopify stores. To track purchases, you need to add a Shopify Web Pixel since checkout happens on Shopify's domain.

Auto-tracked events (no setup needed)

  • ✓ Product page views with product data
  • ✓ Add to cart button clicks
  • ✓ Cart page views

Track Purchases with Shopify Web Pixel

To track checkout completions and purchases, create a custom pixel in Shopify:

  1. Go to Shopify Admin → Settings → Customer events
  2. Click Add custom pixel
  3. Name it "Arktis"
  4. Paste the code below (replace YOUR_SITE_ID)
  5. Click Save → Connect

If you added the Arktis pixel before 25 September 2026, replace it with this version. The earlier snippet sent Shopify's checkout token as the visitor and session, so purchases were not joined to the visitor's journey, and it reported every buyer as having consented. This version reads the visitor and session Arktis already stored on your storefront, reports only the consent the visitor actually gave, and sends the checkout token so the Shopify order can be matched to the visit.

Shopify Web Pixel
// Shopify Web Pixel - joins each purchase to the visitor's Arktis journey
// Go to: Shopify Admin → Settings → Customer events → Add custom pixel

analytics.subscribe("checkout_completed", async (event) => {
  const checkout = event.data.checkout;

  // The Arktis tracker keeps its visitor and session IDs in your storefront's
  // storage (session-only storage when the visitor sends Global Privacy Control).
  const read = async (key) =>
    (await browser.localStorage.getItem(key)) ||
    (await browser.sessionStorage.getItem(key));
  const anonymousId = await read("_arktis_aid");
  const sessionId = await read("_arktis_sid");

  // No tracked visit to join. The order still reaches Arktis through
  // the Shopify connection, so there is nothing more to send.
  if (!anonymousId || !sessionId) return;

  fetch("https://europe-west1-arktis-ui.cloudfunctions.net/ingest", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      site_id: "YOUR_SITE_ID", // Replace with your site ID
      anonymous_id: anonymousId,
      session_id: sessionId,
      // Reports the choice the visitor made on your storefront; never grants consent.
      consent_given: (await browser.localStorage.getItem("_arktis_consent")) === "true",
      events: [{
        event_type: "convert",
        event_name: "purchase",
        page_url: event.context.document.location.href,
        page_path: "/checkout/thank_you",
        properties: {
          order_id: checkout.order?.id,
          // Lets Arktis match the Shopify order to this visit.
          checkout_token: checkout.token,
          value: parseFloat(checkout.totalPrice?.amount || 0),
          currency: checkout.currencyCode,
          items: checkout.lineItems.map(item => ({
            id: item.variant?.product?.id,
            name: item.title,
            price: parseFloat(item.variant?.price?.amount || 0),
            quantity: item.quantity
          }))
        },
        timestamp: new Date().toISOString()
      }]
    }),
    keepalive: true
  });
});

What gets tracked

  • • Order ID and total value
  • • Currency
  • • All purchased items with quantities and prices
  • • Links to visitor's browsing session