| 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. |
If you have a GA4 property and just want tracking to work, this is the simplest option.
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
In Google Analytics, go to Admin → Data Streams → Web Your Measurement ID looks like G-XXXXXXXXXX
Go to your school settings and paste the Measurement ID into the Google Analytics Tracking Code field. Save.
Frontcore will now automatically:
gtag.js on all your pagespage_view eventspurchase events when a booking is completedNo additional configuration in GA4 is needed — purchase events appear automatically under Reports → Monetization → Ecommerce purchases
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.
Go to Google Tag Manager and create a container for your website (type: Web).
See Google's guide: Set up and install Tag Manager
Your Container ID looks like GTM-XXXXXXX. You'll find it at the top of your GTM workspace.
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.
In GTM, create a Google Tag (type: Google Analytics: GA4 Configuration) with your GA4 Measurement ID. Set it to fire on All Pages
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:
purchasepurchasetransaction_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.Click Submit in GTM to publish your changes. Until you publish, no tags will fire.
When a customer completes a booking, Frontcore sends a purchase event with the following data. The format depends on which tracking option you chose.
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'
}
]
});
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"
}
]
});
| Field | Description |
|---|---|
transaction_id | Unique order identifier, prefixed with ORDER_. |
value | Total order value. |
currency | Three-letter currency code (e.g. NOK, SEK, EUR). |
payment_method | Payment method used (if available). |
items[] | Array of purchased items. |
items[].item_id | Product ID. |
items[].item_name | Course / product name. |
items[].price | Price per unit. |
items[].quantity | Number of units. |
items[].item_category | Top-level course category. |
items[].item_category2 | Second-level category (if exists). |
items[].item_category3 | Third-level category (if exists). |
purchase event shows up in the Realtime view.purchase event appears in the debug panel and your GA4 tag fires with the correct data.See: Preview and debug containers