Frontcore Tracking Setup Guide GA4 or GTM

How to connect your Google Analytics 4 or Google Tag Manager account to Frontcore

1. Before You Start

Choose one — not both You can enter either a GA4 Measurement ID or a GTM Container ID. The system only allows one at a time. If you need to switch, clear the current value first.
GA4 (Option A) GTM (Option B)
Best for Simple setup. You just want pageviews and purchase tracking out of the box. Advanced setup. You want full control over tags, triggers, and custom events.
ID format G-XXXXXXXXXX GTM-XXXXXXX
Purchase events Sent automatically to GA4. Pushed to dataLayer. You set up a tag in GTM to forward it to GA4.

2. Option A: Google Analytics 4 (GA4)

If you have a GA4 property and just want tracking to work, this is the simplest option.

1
Create a GA4 property (if you don't have one)

Go to Google Analytics and create a new GA4 property for your website.

See Google's guide: Set up Analytics for a website and/or app

2
Find your Measurement ID

In Google Analytics, go to Admin → Data Streams → Web Your Measurement ID looks like G-XXXXXXXXXX

See: Find your Google tag ID

3
Enter the ID in Frontcore

Go to your school settings and paste the Measurement ID into the Google Analytics Tracking Code field. Save.

4
Done

Frontcore will now automatically:

  • Load gtag.js on all your pages
  • Send page_view events
  • Send purchase events when a booking is completed

No additional configuration in GA4 is needed — purchase events appear automatically under Reports → Monetization → Ecommerce purchases

3. Option B: Google Tag Manager (GTM)

If you want to manage tags yourself (e.g. Google Ads conversions, Facebook Pixel, custom events), use GTM. This requires a few extra steps in GTM to forward purchase data to GA4.

1
Create a GTM container (if you don't have one)

Go to Google Tag Manager and create a container for your website (type: Web).

See Google's guide: Set up and install Tag Manager

2
Find your Container ID

Your Container ID looks like GTM-XXXXXXX. You'll find it at the top of your GTM workspace.

3
Enter the ID in Frontcore

Go to your school settings and paste the Container ID into the Google Tag Manager Code field. Save.

Frontcore will now load your GTM container on all pages and push purchase event data to the dataLayer.

4
Set up a GA4 Configuration tag in GTM

In GTM, create a Google Tag (type: Google Analytics: GA4 Configuration) with your GA4 Measurement ID. Set it to fire on All Pages

See: Set up GA4 in Tag Manager

5
Set up a GA4 Event tag for purchase events

Frontcore pushes a purchase event to the dataLayer when a booking is completed (see data reference below). To forward this to GA4, create the following in GTM:

  1. Trigger: Custom Event, event name = purchase
  2. Tag: Google Analytics: GA4 Event, event name = purchase
  3. Map the event parameters (transaction_id, value, currency, items) from the dataLayer to the tag. The simplest approach is to enable "Send Ecommerce data" on the tag, which picks up the dataLayer values automatically.

See: GA4 ecommerce events in Tag Manager

6
Publish your GTM container

Click Submit in GTM to publish your changes. Until you publish, no tags will fire.

4. Purchase Event Data Reference

When a customer completes a booking, Frontcore sends a purchase event with the following data. The format depends on which tracking option you chose.

GA4 (gtag) format

Sent automatically — no action needed on your part.

gtag('event', 'purchase', {
    transaction_id: 'ORDER_12345',
    value: 4500.00,
    currency: 'NOK',
    payment_method: 'Visa',
    items: [
        {
            item_id: 101,
            item_name: 'Varme arbeider',
            price: 4500.00,
            quantity: 1,
            item_category: 'HMS',
            item_category2: 'Brannvern',
            item_category3: 'Varme arbeider'
        }
    ]
});

GTM (dataLayer) format

Pushed to dataLayer. You need a GA4 Event tag in GTM to forward this to your GA4 property (see step 5 above).

dataLayer.push({
    "event": "purchase",
    "transaction_id": "ORDER_12345",
    "value": 4500.00,
    "currency": "NOK",
    "payment_method": "Visa",
    "items": [
        {
            "item_id": 101,
            "item_name": "Varme arbeider",
            "price": 4500.00,
            "quantity": 1,
            "item_category": "HMS",
            "item_category2": "Brannvern",
            "item_category3": "Varme arbeider"
        }
    ]
});

Fields explained

Field Description
transaction_idUnique order identifier, prefixed with ORDER_.
valueTotal order value.
currencyThree-letter currency code (e.g. NOK, SEK, EUR).
payment_methodPayment method used (if available).
items[]Array of purchased items.
items[].item_idProduct ID.
items[].item_nameCourse / product name.
items[].pricePrice per unit.
items[].quantityNumber of units.
items[].item_categoryTop-level course category.
items[].item_category2Second-level category (if exists).
items[].item_category3Third-level category (if exists).

5. Verifying Your Setup

GA4: Realtime report

  1. Open Google AnalyticsReports → Realtime.
  2. Visit your course page in another tab.
  3. You should see your visit appear within seconds.
  4. To verify purchase events, complete a test booking and check that a purchase event shows up in the Realtime view.

See: Realtime report in GA4

GTM: Preview mode

  1. Open Google Tag Manager and click Preview.
  2. Enter your website URL. A debug panel will open alongside your site.
  3. Navigate your site and verify your GA4 tags fire on page loads.
  4. Complete a test booking and verify the purchase event appears in the debug panel and your GA4 tag fires with the correct data.

See: Preview and debug containers

Ecommerce reports Purchase data typically takes 24–48 hours to appear in the GA4 ecommerce reports under Reports → Monetization → Ecommerce purchases Use the Realtime report or GTM Preview mode for immediate verification.


© 2026 FrontCore