Insightech and Magnolia

Haonan Zhang Updated by Haonan Zhang

Overview

Magnolia is a headless-ready digital experience platform (DXP) and content management system. Magnolia Conversions, powered by Insightech brings Insightech’s session replay, click maps, funnels and error detection to sites built on Magnolia. It is listed on the Magnolia Marketplace.

Magnolia Conversions customers sign in at magnolia.insightech.com. It is the same Insightech platform with Magnolia branding, so every other article in this help centre applies to you as well.

This document shows how to add the Insightech tracking code to a Magnolia site using Magnolia’s Marketing Tags app. No developer changes to your templates are needed.

Prerequisites

  • A Magnolia DX Core or DX Cloud instance with the Marketing Tags module installed.
  • An Insightech profile for the site you want to track, and admin access to that profile.

Step 1: Copy your Insightech tracking code

  1. Sign in at magnolia.insightech.com and open the profile for your site.
  2. Go to Settings → Tracking Code.
  3. Copy the tracking code shown there.

The tracking code looks like this:

<script>
!function(){ var async = function(c){ var d = document, s = d.createElement('script'), h = d.getElementsByTagName('head')[0]; s.src = 'https://cdn.insightech.com/insightech.mini.js'; if(c){s.addEventListener('load', function(e){c(null,e);}, false);} h.appendChild(s); }; async(function(){ insightech = new _InsightechObject("YOUR_PROFILE_ID:YOUR_REGION-api"); }); }();
</script>

This is an example only. YOUR_PROFILE_ID and YOUR_REGION-api (for example us-1-api) are filled in for you in the code shown under Settings → Tracking Code, so always copy it from there rather than from this page.

Step 2: Create an Insightech tag in Magnolia

  1. In Magnolia AdminCentral, open Marketing Tags.
  2. Click Add tag and give it a name, for example insightech-tracking.
  3. Set Placement to <head>.
  4. Paste the tracking code from Step 1 into the Code snippet field.
  5. Set Pages to All pages to track the whole site, or pick a specific page tree.
  6. Click Save & Activate.

Magnolia Community Edition doesn’t include Marketing Tags. Add the tracking code to the <head> of your page template instead, for example by saving it as a JavaScript resource in your module and including it from your FreeMarker template.

Step 3: Allow Insightech in your Content Security Policy

If your site sends a Content Security Policy (CSP) header, allow the following, or the tracking code will be blocked:

Directive

Allow

Why

script-src

https://cdn.insightech.com

Loads the Insightech tracking script.

script-src

The tracking code snippet itself (by nonce or hash, or 'unsafe-inline')

The snippet from Step 1 is an inline script.

connect-src

https://<region>-api.insightech.com

Sends the recorded data to Insightech.

You’ll find your region host in your tracking code: it is the part after the colon in _InsightechObject("<profile id>:<region>-api"). For example, us-1-api means https://us-1-api.insightech.com. To cover all regions with one rule, you can use https://*.insightech.com instead.

magnolia.insightech.com is where you sign in. Your site never contacts it, so it doesn’t need to be in your site’s CSP.

If you use Magnolia’s Cookies app to manage consent, link the Insightech tag to the matching cookie category. Tracking will then start only after the visitor gives consent.

Step 5: Verify tracking is working

  1. Open a published page of your site in your browser.
  2. Open the browser’s developer tools, go to the Network tab and filter by insightech.
  3. You should see the tracking script load from cdn.insightech.com, followed by requests to your region host (for example us-1-api.insightech.com).
  4. In magnolia.insightech.com, open your profile and go to Session Replay. Your visit should appear within a few minutes.

If nothing appears, check the Network tab for blocked requests (usually CSP or consent) and confirm the tag was activated on the pages you visited.

Further reading

Our list of integrations is updating weekly. If you want to know if we integrate with your preferred platform, please get in touch with us here.

How did we do?

Insightech and Dynamic Yield

Contact