PathmonkHelp
Help/Integrations/Connectors/Sending Pathmonk data to GA4 directly

Sending Pathmonk data to GA4 directly

CategoryIntegrations › Connectors
CreatedNov 25, 2026
UpdatedNov 25, 2026

Besides the standard connection, you can send two specific things from Pathmonk to Google Analytics 4 yourself: the A/B group of each visitor, and the conversions of one goal as a GA4 key event. These are advanced set-ups for teams that want that data in GA4. For the standard connection, see Managing your Google Analytics 4 connection. To do the first one with Google Tag Manager instead of code, see Sending your A/B test groups to GA4 with Google Tag Manager.

Part 1: send the A/B group of each visitor

You need access to your website's code.

The three groups

The Pathmonk snippet fires one of three events in the visitor's browser:

EventThe visitor
pathmonkControlGroupPathmonkEnabled: is in the Pathmonk group and can see micro-experiences
pathmonkControlGroupControl group: Pathmonk is active for this visitor but does not show micro-experiences
pathmonkControlGroupDisabledNo group: was tracked after the snippet was installed but before Pathmonk was published, so could not be placed in either group

For how the groups work, see How traffic is split: the control group.

Step 1: make sure GA4 is on your website

The GA4 tag (gtag.js) must be in the <head> of your website:

<script async src="https://www.googletagmanager.com/gtag/js?id=YOUR_GA4_MEASUREMENT_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'YOUR_GA4_MEASUREMENT_ID');
</script>

Replace YOUR_GA4_MEASUREMENT_ID with your own Measurement ID.

Step 2: send each group to GA4

Add this script to your website, after the GA4 tag:

<script>
document.addEventListener("pathmonkControlGroupPathmonk", function() {
  gtag('event', 'pathmonk_displaying', { 'event_category': 'Pathmonk' });
});
document.addEventListener("pathmonkControlGroup", function() {
  gtag('event', 'pathmonk_not_displaying', { 'event_category': 'Pathmonk' });
});
document.addEventListener("pathmonkControlGroupDisabled", function() {
  gtag('event', 'pathmonk_analytics_only', { 'event_category': 'Pathmonk' });
});
</script>

Step 3: check it in GA4

  1. In Google Analytics, open Admin, then DebugView.
  2. Open your website in another tab.
  3. Check that one of the three events appears.

Part 2: send the conversions of a goal to GA4

You can bind a Pathmonk conversion event to a GA4 key event, so each conversion Pathmonk records is also sent to GA4. You need admin access to your GA4 property.

Step 1: get three values from GA4

  1. In Google Analytics, open Admin, then Data streams, and click your data stream.
  2. Copy the Measurement ID. It looks like G-XXXXXXXXXX.
  3. On the same screen, open Measurement Protocol API secrets, click Create, give it a nickname and copy the secret.
  4. Open Admin, then Key events, and check that the key event you want to use exists, for example purchase. Note its name.

Step 2: bind the event in Pathmonk

  1. In the sidebar, open AI Engine and click Event Manager.
  2. Open the event you want to send.
  3. Open the Connected Platforms tab and choose Google GA4.
  4. Connect with your Google account.
  5. Enter the Measurement ID, the Measurement API Secret and the Key Event Name.
  6. Save.

From then on, the conversions of that event are sent to your GA4 key event.

If you get stuck, contact our support team. Our developers can help you with the set-up.