Lockii sends booking and checkout events to Google Analytics, Facebook Pixel, and PostHog when you add your tracking IDs. You can also turn on Lockii Web Analytics for first-party session data inside your reporting hub. All of these follow your visitors' cookie consent.
In the app: Settings → Website & Embeds (scroll to Analytics & Tracking)
What it does
When tracking is configured, Lockii automatically fires events as customers browse products, start checkout, add payment details, and complete a booking. Purchase events are tied to a stable customer identifier so completed bookings show up reliably in Google Analytics, even when the customer pays with Apple Pay or Google Pay.
Lockii Web Analytics runs separately. It collects first-party session data on your hosted pages and embedded widgets, which you can review under Reporting → Web Analytics.
PostHog runs alongside your other tools. When you add a PostHog project key, Lockii sends page views, product views, checkout steps, and purchase events to your PostHog project.
Quick guide
Connect Google Analytics and Facebook Pixel
- Go to Settings → Website & Embeds.
- Scroll to Analytics & Tracking.
- Paste your Google Analytics Measurement ID (GA4:
G-XXXXXXXXXX). - Paste your Facebook Pixel ID if you use Meta ads.
- Changes save automatically.
Connect PostHog
- In the same Analytics & Tracking section, paste your PostHog Project API Key (
phc_...). - Optional: set PostHog API Host if you use PostHog EU Cloud, US Cloud, or a self-hosted instance. Leave blank to use PostHog US Cloud.
- Changes save automatically.
- Place a test booking and confirm events appear in your PostHog live events view.
Enable Lockii Web Analytics
- In the same section, toggle Lockii Web Analytics on.
- Open Reporting → Web Analytics to see sessions, funnel steps, traffic sources, and revenue attribution.
Verify events are flowing
- Place a test booking on your live site (not preview mode).
- Check Google Analytics Realtime, your Pixel events dashboard, or PostHog live events.
- Confirm you see page views, checkout steps, and a purchase event after payment.
Testing from Europe or the UK? Accept cookies first (in your site's banner or Lockii's), or Meta and PostHog events will not appear.
Cookie consent
Lockii follows each visitor's consent choice for analytics and marketing. Where the law does not require opt-in, tracking runs as normal until a visitor opts out.
Who needs to opt in
By default, visitors in the EEA and the UK must opt in before tracking runs. Everyone else is tracked until they opt out. Lockii works out the region from the visitor's device time zone, so there is no extra network request and no delay. If the time zone is unknown, Lockii treats the visitor as needing opt-in.
To require opt-in for every visitor, turn on Require opt-in everywhere in Settings → Website & Embeds → Analytics & Tracking.
What happens before a visitor opts in
- Google Analytics runs in Consent Mode v2. It sends cookieless pings, so Google can still model conversions, and it sets no cookies.
- Facebook Pixel and PostHog do not load. Events from that page view are held and sent if the visitor accepts.
- Lockii Web Analytics stores nothing on the device. It still counts sessions anonymously with a daily-rotating id that cannot follow a visitor across days.
- Server-confirmed purchases (Measurement Protocol) are not sent to Google if the visitor declined analytics. If they declined marketing, the purchase is sent with ad personalisation turned off.
Booking and checkout work exactly the same whatever the visitor chooses.
Lockii's cookie banner
Your Lockii website and your Lockii booking pages (for example book.lockii.app/your-company/browse) show a small cookie banner when a visitor needs to opt in and you have at least one tracking tool connected. Visitors can accept all, reject all, or choose analytics and marketing separately.
If you show your own banner on those pages, turn off Cookie banner in Settings → Website & Embeds → Analytics & Tracking.
Widgets on your own website
When Lockii is embedded on your own website, it never shows its own banner. It reads the choice from your site's banner and passes it on to checkout. Lockii reads these automatically:
- Shopify customer privacy
- Squarespace cookie banner
- Wix cookie banner
- Any IAB TCF v2 consent platform (for example Cookiebot, OneTrust, Usercentrics, Didomi)
- Google Consent Mode, if your banner sets it
If your banner is not on this list, tell Lockii the choice from your banner's callback:
<script>
window.LockiiConsent = window.LockiiConsent || [];
// Call this whenever the visitor makes or changes a choice
window.LockiiConsent.push({ analytics: true, marketing: false });
</script>You can run this before or after the Lockii widget script loads. Once the widget has loaded, window.Lockii.setConsent({ analytics, marketing }) does the same thing.
What Lockii stores in the browser
| Key | Where | Purpose | Set when |
|---|---|---|---|
lockii_consent_<company-id> |
Local storage on Lockii pages | Remembers the visitor's consent choice | The visitor makes a choice |
lockii_widget_visitor_id, lockii_widget_session_id, lockii_widget_last_seen_at |
Local storage on your website | Lockii Web Analytics visitor and session ids | Analytics consent is given, or not required |
lockii_analytics_visitor_id, lockii_analytics_session_id, lockii_analytics_last_seen_at |
Local storage on Lockii pages | Lockii Web Analytics visitor and session ids | Analytics consent is given, or not required |
Google Analytics, Facebook Pixel, and PostHog set their own cookies only after the matching consent.
Google Analytics setup checklist
Bookings complete on Lockii's booking domain (book.lockii.app, or your custom booking domain if you have one connected), not on your website's domain. These one-time steps in your GA4 admin keep sessions and conversion attribution accurate across that hop. Lockii carries the visitor's Google Analytics identity from your website through to checkout automatically, but Google also needs to know the two domains belong together.
Cross-domain tracking — In Google Analytics go to Admin → Data streams → your web stream → Configure tag settings → Configure your domains, and add
book.lockii.app(and your custom booking domain if you use one). This tells Google to treat your website and your booking pages as one continuous journey.List unwanted referrals — In the same tag settings area, open List unwanted referrals and add:
lockii.app(coversbook.lockii.appand related Lockii booking domains)- your own website domain (for example
yourcompany.com) - your custom booking domain, if you use one
This stops Google from treating hops between your website and Lockii as a new referral source, so the original source (for example a Google Ads click) keeps the credit.
If you are seeing unexpected
referraltraffic from your own site or from Lockii in Google Analytics, add those domains here.Measurement Protocol API secret (optional, recommended) — Go to Admin → Data streams → your web stream → Measurement Protocol API secrets and click Create. Copy the secret and paste it into Settings → Website & Embeds → Analytics & Tracking → GA4 Measurement Protocol API Secret in Lockii. With this configured, Lockii sends a server-confirmed purchase event to your Google Analytics property the moment payment succeeds, so conversions are recorded even if the customer closes the page before payment completes, uses an ad blocker, or their browser blocks tracking. Lockii deduplicates this against the normal browser event, so purchases are never double-counted. It follows the visitor's consent, as described above.
Events Lockii sends
| Event | When it fires | Platforms |
|---|---|---|
| Page view | Customer loads a booking page | Google Analytics, Facebook Pixel, PostHog |
View item (product_viewed in Lockii Web Analytics) |
Customer views a product in your browse widget or hosted page | All platforms when configured |
| Begin checkout / InitiateCheckout | Customer opens checkout with items and dates selected | Google Analytics, Facebook Pixel, PostHog |
| Add payment info / AddPaymentInfo | Customer enters payment details on the checkout form | Google Analytics, Facebook Pixel, PostHog |
| Purchase | Payment succeeds and the booking is confirmed | Google Analytics, Facebook Pixel, PostHog |
Purchase events include booking value, currency, and order ID. If you have added a Measurement Protocol API secret, Lockii also sends a server-confirmed purchase event after payment succeeds, deduplicated against the browser event.
How customer identity works in Google Analytics
With analytics consent, Lockii sets a user_id in Google Analytics after checkout so purchases from the same customer stitch together across sessions.
- Lockii customer IDs (for example
customer_abc123) are sent as-is. - Email addresses and phone numbers are hashed before they reach Google Analytics. Raw contact details never leave Lockii as a user ID.
- Purchase events use a reliable delivery method so the event is less likely to be lost when the customer is redirected to their confirmation page.
- When a customer moves from your website into an embedded widget or on to checkout, Lockii carries their Google Analytics client and session identity across automatically, so the whole journey appears as one session attributed to the original traffic source.
If you use Google Ads enhanced conversions, Lockii also sends email and name data when a customer is identified at checkout and has given marketing consent. Google hashes this data before it is used.
Tips
- Complete the Google Analytics setup checklist above. Cross-domain tracking and List unwanted referrals are the two settings that most commonly cause bookings to show up as
referraltraffic instead of the ad or search click that actually drove them. - Seeing unexpected referrals from your own website or Lockii? Add your domain and
lockii.appunder Admin → Data streams → Configure tag settings → List unwanted referrals. - Test on your deployed site. Some website builders block embedded scripts in preview mode.
- Use Lockii Web Analytics to see where customers drop off in the booking funnel, then pair with Google Analytics or PostHog for deeper product analytics.
- Make sure your privacy policy covers the analytics and pixel tools you connect, and that your own site's cookie banner lists them.
