When a demo is embedded on your site, it can tell your own analytics what viewers do in it: which steps they saw, what they picked, which buttons they clicked and when they left their email. You add one small script next to the embed. It passes the events to Google Analytics 4, Google Tag Manager and Segment, whichever your page already runs.
Pro and Team plans. The demo’s own analytics in AtriumKit work on every plan, with or without this.
Add the script
-
Open the demo and click the Share tab. Send demo events to your analytics has its own section in the panel on the right, under the Link, Embed and Personalized tabs. (From the demo’s Analytics tab, Send these events to GA4, Google Tag Manager or Segment takes you there.)
-
Copy the script line:
<script src="https://www.atriumkit.com/embed/events/v1.js" async></script> -
Paste it anywhere on each page that embeds the demo. Embedding it for the first time? Click include it in the embed code: the Embed tab’s code gets the line, and you paste it all into your page as usual.
One script is enough for every AtriumKit demo on a page. If your site has a Content-Security-Policy, allow https://www.atriumkit.com in script-src.
What your tools get
| Tool | What the script does |
|---|---|
Google Analytics 4 (gtag) |
gtag('event', 'atriumkit_step_viewed', { demo_title, step_title, … }) |
| Google Tag Manager | dataLayer.push({ event: 'atriumkit_step_viewed', atriumkit: { … } }) |
| Segment | analytics.track('Demo Step Viewed', { … }) |
The events:
| Event (GA4 and Tag Manager) | Segment | When |
|---|---|---|
atriumkit_demo_started |
Demo Started | The demo is first shown |
atriumkit_step_viewed |
Demo Step Viewed | A step (or a screen of a clickable demo) is shown |
atriumkit_choice_made |
Demo Choice Made | The viewer picks a choice |
atriumkit_cta_shown |
Demo CTA Shown | The call-to-action button appears |
atriumkit_cta_clicked |
Demo CTA Clicked | A button with a link is clicked |
atriumkit_scheduler_opened / _closed |
Demo Scheduler Opened / Closed | The scheduler popup opens or closes |
atriumkit_meeting_booked |
Demo Meeting Booked | A meeting is booked in the popup (Calendly, HubSpot) |
atriumkit_form_submitted / _skipped |
Demo Form Submitted / Skipped | A lead form is sent or skipped |
atriumkit_lead_captured |
Demo Lead Captured | The viewer leaves their email |
atriumkit_demo_completed |
Demo Completed | The viewer reaches the end |
atriumkit_intro_played / _skipped |
Demo Intro Played / Skipped | The intro video is played or skipped |
atriumkit_view_changed |
Demo View Changed | A phone is turned on its side |
atriumkit_flow_started / _completed |
Demo Flow Started / Completed | The viewer starts or finishes a flow of the demo’s checklist |
Each event has demo_slug, demo_title, demo_type and session_id, plus what fits: step_id, step_number, step_title, step_total, choice_label, cta_label, cta_url, cta_placement, scheduler, lead_source, view_mode, flow_id and flow_title.
In GA4, register the parameters you want in reports as custom dimensions (Admin → Custom definitions, event scope). In Tag Manager, add a Custom Event trigger with the event name atriumkit_.* (use regex matching) and Data Layer Variables like atriumkit.step_title. If GA4 runs inside Tag Manager, send the events from Tag Manager and add data-ga4="false" to the script tag so nothing is counted twice.
Identify viewers who leave their email
In the same section, under Your sites, list the sites that embed the demo, like https://www.example.com. On pages of those sites, when a viewer leaves their email, the script also calls Segment’s analytics.identify({ email, name }) and pushes { event: 'atriumkit_identify', atriumkit_user: { email, name } } to the dataLayer.
List sites by their https:// address: the email never goes to an http:// page, where it could be read on the way.
Other pages never get the email. GA4 never gets it either: GA4 doesn’t allow personal data in events. Viewers whose browser asks not to be tracked (Global Privacy Control or Do Not Track) are never identified.
The other events still reach your page for those viewers: which steps they saw, what they clicked, that they left an email (without the email). They go only to your own page, where your analytics and your consent banner decide what happens next. If you want a privacy signal to stop them too, check navigator.globalPrivacyControl in your page before passing events on.
Consent
The script doesn’t load any tool or set cookies. It only uses what your page already runs, so your consent setup decides: with GA4 consent mode, gtag follows the viewer’s choice, and when your consent banner keeps Segment or Tag Manager from loading, the events don’t go there either.
Options
Add these to the script tag:
data-ga4="false",data-gtm="false"ordata-segment="false"leaves that tool out.data-identify="false"never identifies viewers.data-debug="true"logs each event in the browser console, to check your setup.
To handle events in your own code, use AtriumKit.onEvent((event) => { … }) after the script has loaded.
Good to know
- Hosted pages (the
atriumkit.com/d/…link) don’t load your analytics tags. Embed the demo on your own site to use them. - Event titles and button text use your demo’s default wording, never what a viewer’s link or answers filled in.
- Collections don’t send these events yet.
For developers: the messages behind the script
Without the script, your page can subscribe itself. Send { source: 'atriumkit-host', type: 'subscribe', v: 1 } to the iframe (after its ready message). It answers { source: 'atriumkit-player', type: 'subscribed', v: 1 }, then sends every event, including the ones from before you subscribed:
{ source: 'atriumkit-player', type: 'event', v: 1, name: 'step_viewed', ts: 1794285142391,
session: 's_4cae10bc…', demo: { slug: 'k3x9q2', title: 'Send your first invoice', type: 'guided' },
data: { step_id: 'st_1', step_index: 0, step_number: 1, step_title: 'Start in Invoices', step_total: 7, … } }
Events go only to the page that embeds the demo, at its own address. Version 1 only gains events and fields; it never renames or removes them.