Google Analytics 4 & Meta (Facebook) tracking for booking
A guide for merchants on how to connect Google Analytics 4 (GA4) and the Meta (Facebook) Pixel to your booking products in Periode, how to make sure ad clicks are actually tracked, and how to embed the booking flow in an iframe on your own website.
How tracking works in Periode
Periode tracks completed bookings as server-to-server conversions. You do not need to add a GA4 or Meta Pixel snippet to the Periode booking pages. Periode sends the purchase event directly to Google and Meta from the backend when a booking is completed. Gift card purchases can be reported the same way, see Gift card purchases, and so can subscription signups, see Subscription signups.
The setup has two steps for each platform:
- Register your credentials once under
Settings > Integrations. - Turn the integration on for each booking product that should report conversions.
Setting this up over the API. Both steps can be scripted — useful when you provision many customers from your own tooling. Register the credentials with
POST /merchants/:id/integrationSecrets, then setga4Integration/metaIntegration(the credentialname) on each booking product viaPUT /merchants/:id/products/booking/:productId. See the Integrations guide for the request bodies. Nothing needs to be sent to Periode — each customer’s own measurement IDs and tokens stay in their own merchant.
For a conversion to be attributed to your campaign, the visitor’s click ID
(gclid for Google Ads, fbclid for Meta) has to reach Periode. Periode reads
these from the URL when the customer opens a Periode page, so how you link to
Periode from your ads matters. See the next section.
Most important: make sure the ad click reaches Periode
Attribution only works if the click ID is present in the URL when the customer lands on a Periode page. Periode reads the following query parameters from the landing URL and keeps them, for the merchant whose page the customer landed on, while they move between Periode pages and complete a purchase:
gclid: sent by Google Ads (auto-tagging). Attributes the booking to Google.fbclid: sent by Meta / Facebook Ads. Attributes the booking to Meta.client_id: from your GA4 setup. Stitches the booking to a GA4 user, when analytics is allowed.session_id: from your GA4 setup. Stitches the booking to a GA4 session, when analytics is allowed.
There are two supported ways to make this work.
Option A (recommended): link your ads directly to the booking product
Point the ad’s destination URL straight at the Periode booking product:
https://minside.periode.no/booking/<merchantId>/<bookingManifestId>
Google Ads and Meta automatically append gclid and fbclid to the destination
URL, so when the ad points directly at Periode, the click ID arrives on its own
and the conversion is tracked. No extra work needed.
You can find a product’s booking URL in the Backoffice, or use the short link
https://minside.periode.no/b/<bookingManifestId>.
Option B: if you route through your own website first, forward the parameters
If your ad sends the customer to your own website first (for example your
front page) and then on to Periode, the gclid or fbclid lands on your
page, not on Periode. In that case you must carry the parameters over to the
Periode link (or iframe src) yourself, otherwise the click ID never reaches
Periode and the booking is not attributed.
When you build the link or iframe that opens Periode, append the same parameters you received:
https://minside.periode.no/booking/<merchantId>/<bookingManifestId>?gclid=<gclid>&fbclid=<fbclid>
If you use GA4 and want the booking stitched to the visitor’s GA4 session, also
pass client_id and session_id, together with the visitor’s analytics answer
from your cookie banner:
...?client_id=<gaClientId>&session_id=<gaSessionId>&analytics_storage=granted
Periode uses client_id and session_id only when analytics is allowed —
analytics_storage=granted or ad_user_data=granted on the link, or the
customer allowing it on the checkout, see Customer consent. Without it they are stored on the booking,
but the purchase is reported without joining the visitor’s session. For visitors
who decline analytics, leave client_id and session_id off the link: GA4 can
still hand out a temporary ID after a decline, so the ID alone says nothing about
consent.
Read both values with gtag('get', '<G-XXXXXXXXXX>', 'client_id', callback) and
gtag('get', '<G-XXXXXXXXXX>', 'session_id', callback). client_id has the form
<digits>.<digits> (for example 878785480.1793138685); a client_id in any
other form is ignored. session_id is passed on to GA4 exactly as you send it,
so send the session ID itself (for example 1794391673). Do not read it from the
_ga_<ID> cookie: the cookie value (GS2.1.s1794391673$o3$g1$t1794391693$...)
is not the session ID, Google changes its format without notice, and GA4 cannot
match it to the visitor’s session.
The visit: Periode keeps these values in the address bar as the customer moves between Periode pages — nothing is stored in a cookie or in the browser’s storage. They are stored with the purchase, not sent to Vipps, Adyen or Stripe, and your thank-you redirect gets them from there after payment. The purchase must be made in the same visit as the customer arrives with the parameters, or the conversion won’t be attributed. Links to other sites get only the
utm_*parameters, never these. The values belong to the merchant whose page the customer landed on: moving to another merchant’s page inside Periode doesn’t hand them over, unless the customer follows a link a merchant has added from its own page straight to another merchant’s page.
Part 1: Google Analytics 4
What you need from Google
- Measurement ID: looks like
G-XXXXXXXXXX(in Google Analytics,Admin > Data streams > your web stream). - API Secret: created under the same web stream
(
Measurement Protocol API secrets > Create).
Step 1: Register GA4 in Periode
- In the Backoffice, go to
Settings > Integrations. - Click Google analytics 4.
- Fill in:
- Name: a label of your choice, e.g.
Main website. Used only to identify the integration inside Periode. - Measurement ID: your
G-XXXXXXXXXXID. - API Secret: the secret you created in Google.
- Name: a label of your choice, e.g.
- Save.
Step 2: Choose which products report to GA4
After you save in Step 1 you stay on the Google Analytics 4 page. Under Integration for all products, select the integration you registered in Step 1, click Save and confirm. Every product you have gets it, in place of the integration it had, and every product you create from now on gets it too. To stop reporting, clear the selection and save.
This covers bookings, subscriptions, gift cards, gift memberships, punch passes and single payment products. The table below shows each product and the integration it reports with.
A booking, subscription or gift card product can also be given another integration, or none, on the product itself. It keeps that until you save Integration for all products again. For a booking product:
- Open the booking product
(
Booking > Products, thenEditon the product). - Go to the Admin section.
- Under Google Analytics 4 integration, select the GA4 integration you registered in Step 1.
- Save.
From now on, every completed booking of a product that reports to GA4 sends a
GA4 purchase
event (transaction ID, value, and currency) via the Measurement Protocol.
Customer details (email, name, phone) are sent as SHA-256 hashed user-provided
data, in line with Google’s requirements — no readable personal data is sent to
GA4 — and only for bookings that carry a granted consent, see
Customer consent.
To let GA4 use the hashed customer details, enable User-provided data collection in Google Analytics (
Admin > Data collection and modification > Data collection).
A product reports only if it has an integration, from Integration for all products or the product’s own settings.
Customer consent
If you keep the customer’s consent decision on your own site, Periode can take it with the booking and report accordingly.
Every booking carries the consent values you send and returns them in the bookings API and the webhook. They also decide what Periode passes on to Google and Meta: customer details and the ad click ID go only with a granted consent, and the purchase joins the visitor’s GA4 session only when analytics is allowed.
Passing consent from your own consent banner
If you already ask for consent — a cookie banner on your site, a consent screen
in your app — pass the answer on the booking link, alongside gclid and the
other campaign parameters:
| Parameter | Value |
|---|---|
ad_user_data | granted or denied |
ad_user_data_at | the moment the customer answered, ISO 8601 in UTC |
analytics_storage | granted or denied (optional) |
ad_user_data covers advertising measurement and ad personalization together —
Periode sets GA4’s ad_user_data and ad_personalization to the same value.
analytics_storage is the analytics answer, kept apart from advertising the way
Google’s Consent Mode keeps them apart. It decides one thing only: whether the
purchase joins the visitor’s own GA4 session through the client_id and
session_id on the link. Leave it out and the ad_user_data answer decides
that too.
/booking/<merchantId>/<productId>?ad_user_data=granted&ad_user_data_at=2026-09-20T09:15:00Z
A customer who accepts analytics but declines advertising:
/booking/<merchantId>/<productId>?ad_user_data=denied&analytics_storage=granted&client_id=<gaClientId>&session_id=<gaSessionId>
These values are stored on the booking and come back in the bookings API and the booking webhook:
| Field on the booking | Comes from | Value |
|---|---|---|
gclid | gclid | as sent |
fbclid | fbclid | as sent |
gaClientId | client_id | as sent |
gaSessionId | session_id | as sent |
adUserData | ad_user_data | true for granted, false for denied |
adUserDataAt | ad_user_data_at | as sent |
analyticsStorage | analytics_storage | true for granted, false for denied |
The consent answers are stored as booleans: ad_user_data=granted comes back as
adUserData: true, and denied as adUserData: false; analytics_storage
likewise as analyticsStorage.
A parameter you do not send is left absent on the booking rather than filled
with a default, so absence means “no answer” and is distinct from false.
The four campaign identifiers are kept and stored whatever the consent value says — they are yours, and you may need them to do your own reporting. Consent governs what Periode sends onward to Google and Meta, not what it keeps for you.
If you embed the booking flow in an iframe, forward the parameters onto the
iframe src.
Asking on the checkout
When the link carries a campaign or GA4 identifier (gclid, fbclid,
client_id or session_id) but no consent answer, and the product has a GA4 or
Meta integration, Periode asks the customer on the checkout. This applies to
bookings, gift cards, subscription signups and gift memberships. The customer
gets two separate, unticked options:
- Analytics: link the purchase to their visit in the website analytics.
Sent as
analyticsStorage. Shown only when the product has a GA4 integration and the link carries a validclient_id, since that is the only thing the answer changes. - Advertising: use the purchase for advertising measurement and
personalization. Sent as
adUserData.
An answer already on the link wins, and its option is not shown. Once the
customer ticks either option, both shown options are recorded — an unticked one
as false — with adUserDataAt set to when they answered. A customer who leaves
both unticked has no answer recorded, which is treated as denied.
For a booking, which options to show is decided when the reservation is created and kept on it, so they stay on the page after a reload, pre-filled with any answer already given, and the customer can change it until they pay.
Analytics and advertising are separate purposes, so they are asked separately: UK GDPR and the EU GDPR both require consent to be specific and granular, and a single box covering both would not be valid consent for either.
What is sent
Every completed purchase is reported. What it carries depends on the consent on the purchase:
| Consent on the purchase | GA4 | Meta |
|---|---|---|
| Ads granted | The purchase in the visitor’s session, with the hashed customer details and the ad click ID | The purchase with the hashed customer details and the ad click ID |
| Analytics granted only | The purchase in the visitor’s session | An anonymous purchase |
| Neither | An anonymous purchase | An anonymous purchase |
A purchase in the visitor’s session gets that session’s source, medium and
campaign in GA4. It needs client_id and session_id on the link, and is left
out of the session when the link says analytics_storage=denied.
An anonymous purchase carries only the product, price, currency and transaction ID. GA4 counts each one as a new visitor, and Meta shows it in Events Manager without matching it to a person or an ad. To send nothing to Meta without ad consent, ask Periode to switch on No Meta without ad consent for your account.
UTM tags. When the customer came in on a link with utm_* tags, the
purchase carries them, so GA4 can credit the campaign even when the purchase is
not in a session. They show under Source / medium and Campaign for key
events, not under Session source / medium. Put UTM tags only on links from
outside your site, such as emails, posters, ads and social profiles. Fixed tags
on your own site’s booking buttons would credit every sale to your own site.
UK merchants: the statistics exemption
From 5 February 2026 the UK Data (Use and Access) Act 2025 adds an exception to PECR: storage and access used only for statistics — to understand and improve how a site or service is used — no longer needs prior consent, as long as visitors have a simple, free way to object.
Periode never assumes analytics is allowed: a purchase joins the visitor’s GA4
session only when the link says so. If your site relies on the exception, add
analytics_storage=granted to the booking or gift card link for visitors who
have not objected, and analytics_storage=denied for those who have. Your site
is where visitors object, so it is the one that knows which applies. A link
without the parameter is reported as an anonymous purchase, as described above.
Hashed customer details and click IDs still go only with ad_user_data=granted.
If you also want nothing at all to go to Meta without it — not even the
anonymous purchase — ask Periode to switch on No Meta without ad consent for
your account.
Whether the exception covers your own analytics setup is yours to judge against
the ICO’s guidance; Periode only acts on the answer your link sends. The exception
is narrow: it applies only to aggregate statistics about how your own service is
used, and the ICO’s guidance says it does not cover tracking or monitoring
individual visitors, or anything linked to advertising. Joining a purchase to a
visitor’s own session through the client_id and session_id, and attributing
it to the campaign that brought them, is individual-level, so satisfy yourself it
stays within the exception before sending analytics_storage=granted on the
strength of it. It also assumes your GA4 is configured so the data is used only
to improve your service — your analytics
provider acting as your processor, with Google signals and Google Ads linking off
— and that you give visitors a genuinely free and easy way to object that passes
analytics_storage=denied back to the booking link. The decision, and the duty
to meet these conditions, stay yours as the controller.
If you send all conversions yourself from your own server-side container, leave the GA4 and Meta integrations switched off in Periode. The booking still stores and returns everything above, so you have what you need.
Part 2: Meta (Facebook) Pixel
Setup mirrors GA4.
What you need from Meta
- Pixel ID: a numeric ID from
Meta Events Manager > your dataset. - Access Token: a Conversions API access token generated for that dataset
(
Settings > Conversions API > Generate access token).
Step 1: Register Meta in Periode
- Go to
Settings > Integrations. - Click Meta.
- Fill in:
- Name: a label of your choice, e.g.
Facebook ads. - Access token: your Conversions API token.
- Pixel ID: your numeric Pixel ID.
- Name: a label of your choice, e.g.
- Save.
Step 2: Choose which products report to Meta
As for GA4, the Meta page has the same setting once you have saved: select the integration under Integration for all products, click Save and confirm. Every product you have gets it, and so does every product you create from now on. The table below shows the integration each product reports with.
A booking, subscription or gift card product can also be given another integration, or none, on the product itself. It keeps that until you save Integration for all products again. For a booking product:
- Open the booking product (
Booking > Products, thenEditon the product). - Go to the Admin section.
- Under Meta Pixel API integration, select the Meta integration you registered.
- Save.
Completed bookings of a product that reports to Meta now send a Meta
Conversions API Purchase event. Customer
details (email, name, phone) are hashed before being sent, in line with Meta’s
requirements, and only for bookings that carry a granted consent — see
Customer consent.
Gift card purchases
Gift card purchases are reported the same way as bookings, with the same link parameters and the same consent rules.
- Register the credentials once, as in Step 1 of Part 1 and Part 2.
- Open the gift card product
(
Gift cards, then edit the product), go to Advanced, and pick the integration under Integration with Google Analytics 4 and/or Integration with Meta Pixel API. - Link to the gift card purchase page with the same parameters as a booking
link —
gclid,fbclid,client_id,session_id, and the consent valuesad_user_data,ad_user_data_atandanalytics_storage:
https://minside.periode.no/gift-card/<giftCardManifestId>?gclid=<gclid>&ad_user_data=granted
When the payment completes, Periode sends one purchase event to GA4 and one
Purchase event to Meta for the whole purchase. Its value is the amount paid, so
three 500 NOK gift cards bought together are one 1,500 NOK purchase. The product
is the gift card product’s name, the transaction ID is the purchase’s own ID,
shared by every gift card bought in it, and the customer details are the
buyer’s. What goes with and without consent is the same as for a booking, see
What is sent, and the same goes for the
UK statistics exemption and the No
Meta without ad consent setting.
The click and consent values are kept on the purchase. If the product has a
redirect link, Periode appends giftCardId (the first card of the purchase),
purchaseId (one id for the whole purchase, so you can count each purchase
once), and amount (the total paid, in minor units such as cents), followed by
the same campaign and consent parameters as for a booking, see
Sending the customer to the confirmation page.
The periodePurchase iframe event in Part 3 is fired for bookings only.
Subscription signups
Subscription signups are reported the same way as bookings, with the same link parameters and the same consent rules.
- Register the credentials once, as in Step 1 of Part 1 and Part 2.
- Open the subscription product
(
Subscriptions, then edit the product), go to Advanced > API and integrations, and pick the integration under Integration with Google Analytics 4 and/or Integration with Meta Pixel API. - Link to the signup page with the same parameters as a booking link —
gclid,fbclid,client_id,session_id, and the consent valuesad_user_data,ad_user_data_atandanalytics_storage:
https://minside.periode.no/signup/<manifestId>?gclid=<gclid>&ad_user_data=granted
When the first payment succeeds, Periode sends one purchase event to GA4 and
one Purchase event to Meta. Its value is the amount charged at signup, the
product is the subscription product’s name, the transaction ID is the
subscription’s own ID, and the customer details are the subscriber’s. What goes
with and without consent is the same as for a booking, see
What is sent, and the same goes for the
UK statistics exemption and the No
Meta without ad consent setting.
Prepaid signups (the customer pays several periods up front) and gift memberships bought for someone else are reported the same way, each once, when the purchase is paid — with the amount paid as the value. A gift membership is reported when it is bought, not when the recipient later redeems it, so it is counted once and only where the ad click and consent were. Forward the same parameters onto the gift purchase link.
Reporting the sign-up from your own page
If the product has a Return URL (Advanced > API and integrations), Periode
sends the customer there after the sign-up is paid and appends:
subscriptionId— the sign-up’s unique id. Use it to count each sign-up once, even if the page is reloaded.productId— the subscription product’s id.amount— the amount charged at sign-up, in minor units such as cents. Use it as the conversion value. On a prepaid sign-up it is the full amount paid up front.- the click and consent values that reached Periode —
gclid,fbclid,client_id,session_id,ad_user_data,ad_user_data_atandanalytics_storage— each present only when it was captured.
https://your-site.example/thank-you?subscriptionId=<id>&productId=<id>&amount=2750&gclid=<gclid>&ad_user_data=granted
The same values are stored on the subscription and returned in the subscription API and webhook, so a server can read them there instead.
To report from your own page, set a Return URL and leave the GA4/Meta integration off on the product, also after Integration for all products set one, and turn it off again after each time you save that setting. If an integration is set, Periode reports the sign-up server-to-server as well and it is counted twice.
What is stored. The click and consent values that reached Periode are kept on the subscription, forwarded onto the Return URL and returned in the API and webhook. They are only sent on to GA4 or Meta as the consent values allow, see What is sent.
Punch passes and single payment products
Punch passes and single payment products have no integration setting on the product page. They get the one under Integration for all products, also when they are created after it was saved. Each purchase is reported once, when it is paid, with the amount paid as the value. The product name is the punch pass or product’s name, the transaction ID is the purchase’s own ID, and the customer details are the buyer’s.
Link to the purchase page with the same parameters as for a booking, see Most important: make sure the ad click reaches Periode, and pass the customer’s consent from your own consent banner, see Customer consent. Periode does not ask for consent on the punch pass or product checkout. What goes with and without consent is the same as for a booking. A member changing to another subscription plan is not reported.
Part 3: Embedding the booking flow in an iframe
You can embed Periode’s booking flow inside a page on your own website using an
<iframe>. This lets customers book without leaving your site, while Periode
still handles the booking, payment, and confirmation.
Remember the rule above: if you embed Periode in an iframe from a page that received an ad click, forward
gclidandfbclidonto the iframesrcso attribution still works (Option B).
The confirmation view
After a booking is paid, the customer lands on Periode’s booking confirmation page:
https://minside.periode.no/bookings/<merchantId>/<bookingId>
Adding ?slim=true renders a slim version of this page. Chrome and
navigation are stripped away so it fits cleanly inside an iframe:
https://minside.periode.no/bookings/<merchantId>/<bookingId>?slim=true
Sending the customer to the confirmation page (Redirect URL)
To control where the customer goes after a completed booking, set a redirect URL on the product itself:
- Open the booking product (
Booking > Products, thenEditon the product). - Go to
Details > Advanced. - Fill in the field “Redirect after completed purchase with query param: bookingId”.
When a booking is completed, Periode redirects the customer to this URL and appends the booking ID as a query parameter:
https://your-site.example/thank-you?bookingId=<bookingId>
Do not paste a hinted path with {bookingId} and expect Periode to replace it.
Periode appends the booking ID as a query parameter (?bookingId=<id>). Build
the redirect page so it reads that parameter and loads the matching confirmation
or thank-you content.
Any campaign and consent values stored on the booking are appended too, under the same names you would have sent them in on the booking link:
| Parameter | From the booking |
|---|---|
gclid / fbclid | the ad click that led to the booking |
client_id / session_id | the GA4 identifiers you passed in |
ad_user_data | granted or denied |
ad_user_data_at | when the customer answered |
analytics_storage | granted or denied |
utm_source … utm_content | the campaign link the customer came in on |
https://your-site.example/thank-you?bookingId=<bookingId>&gclid=<gclid>&ad_user_data=granted
A value that is not on the booking is left out, so only the parameters you actually have come back. Because the names match the inbound ones, your thank-you page can read them the same way your landing page does — useful for firing your own conversion tag with the right click ID, and for setting Consent Mode on the page from the answer the customer already gave.
The click IDs come back whatever the consent answer says: they are your data on your own site. Consent governs what Periode sends onward to Google and Meta, as described under Customer consent.
The same parameters are appended to the redirect after a gift card, subscription, prepaid subscription or single payment product purchase. A single payment product keeps the click and consent values for this when it has a redirect after purchase.
The purchase event for your own GA4 / GTM
When the slim confirmation page loads inside an iframe, Periode also pushes a client-side ecommerce event so that your own Google Tag Manager or GA4 (the one running on your website, outside Periode) can pick up the conversion.
Because the event is fired inside the iframe, Periode relays it to the parent page
with postMessage. Add a listener on your page to forward it into your own
dataLayer:
<script>
window.addEventListener('message', function (event) {
// Only trust messages coming from Periode
if (event.origin !== 'https://minside.periode.no') return;
if (!event.data || event.data.source !== 'periode') return;
if (event.data.event === 'periodePurchase') {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: 'periodePurchase',
ecommerce: event.data.ecommerce,
});
}
});
</script>
The ecommerce payload contains the standard fields you can use to configure a
purchase tag in GTM:
{
"transaction_id": "<bookingId>",
"value": 499.0,
"currency": "NOK",
"items": [{ "item_id": "<bookingProductId>", "item_name": "<bookingProductName>", "price": 499.0, "quantity": 1 }]
}
Values are sent in major currency units. For example, a NOK 499.00 booking is
sent as 499.0, not 49900.
The event fires once per booking (it is de-duplicated per transaction), so a customer who reloads the confirmation page will not trigger a second conversion.
Which method should I use?
- Report conversions to your GA4 property: Part 1 (server-side, no code on your site).
- Report conversions to Meta / Facebook Ads: Part 2 (server-side, no code on your site).
- Make sure ad clicks are attributed: link ads directly to the booking product, or forward the URL parameters (the “Most important” section).
- Show the booking flow inside your own website: Part 3 (iframe plus redirect URL).
- Fire a purchase event in your own GTM or GA4 on your site: Part 3
(
periodePurchaseviapostMessage).
The server-side integrations (Parts 1 and 2) and the iframe dataLayer event
(Part 3) are independent. You can use either, or both together.