Tag management integration

Trigger A/B test conversions from Google Tag Manager: Optibase + GTM integration

Optibase exposes a single function, optibaseSendConversionEvent('your-conversion-id'), that you call from any GTM Custom HTML tag. The conversion fires the moment your existing GTM trigger fires. No duplicate event setup, no separate conversion definitions.
One JavaScript line in a GTM Custom HTML tag fires an Optibase conversion.
Reuse every existing GTM trigger. Form submissions, purchases, scroll depth, anything you already track.
Variant data available in the dataLayer for every other tag in your container to consume.
Header image
Join 3000+ companies already testing with Optibase
About GTM

What is Google Tag Manager?

Google Tag Manager is Google's free tag-management system, used on millions of sites to deploy analytics, advertising, and tracking pixels without code changes. For most marketing teams, GTM is already the central nervous system: every form submission, every purchase, every scroll-depth milestone is already wired up there.
That makes GTM the obvious place to define A/B test conversions too. Optibase plugs directly into GTM with a single function call, so the event-tracking work your team already did becomes the conversion definition for every test.
Why this integration

Why connect Optibase to GTM

A/B testing icon

Stop duplicating conversion definitions

Without a GTM integration, every conversion you want to test has to be defined twice: once in GTM, once in your A/B testing tool. Optibase reuses your GTM trigger directly, so the work you already did to define a "purchase" or "form submit" event becomes the conversion definition for every test you run.

Variant data flows to every other tag automatically

The same Optibase script that runs the test exposes the variant in the page-side JavaScript. You can push it into the dataLayer with one line, and every other tag in your container (Facebook Pixel, LinkedIn Insight, Google Ads Conversion) gets variant-aware retargeting and reporting for free.

 Server-side GTM works the same way

If your team has moved to server-side GTM for performance and privacy reasons, the integration still works. Trigger the Optibase conversion from your server-side container the same way you would client-side. No second integration to learn.
Use cases

What you can run with Optibase + GTM

Existing GTM purchase event becomes an Optibase conversion

Your team already wired GTM to fire on every purchase. Add a one-line Custom HTML tag with optibaseSendConversionEvent('purchase') attached to the same trigger. Now every Optibase pricing-page test automatically counts purchases as the conversion, no extra setup per test.
Conversion tracking icon

Form submission tracked via GTM, conversion in Optibase

Your contact form fires a GTM event on submit. Add the Optibase function call to the same trigger. Every Optibase test of the contact form counts submissions as conversions, with no developer involvement.

Variant-aware retargeting via Facebook Pixel

Push the Optibase variant into the GTM dataLayer. Configure your Facebook Pixel tag to read the variant as an event property. Run a Facebook retargeting campaign segmented by which variant the user saw on your site.

Server-side GTM, server-side Optibase conversion

Your server-side container catches a Stripe webhook for a successful checkout. Fire optibaseSendConversionEvent('checkout-complete') from the server-side tag. The conversion attaches to the variant the user saw, even though the conversion event happened server-side.
Setup

How to set up the GTM integration

The setup is a Custom HTML tag in GTM with one JavaScript line. Total time: about five minutes.

Identify the conversion you want to track

Pick the conversion event you want to attribute to Optibase tests. This is usually something you already track in GTM (purchase, form submit, signup click, etc.).

Create or pick the matching GTM trigger

You probably already have a trigger for this event. Reuse it. If you don't, create a trigger that matches the user action (form submit, click on a specific element, page view of a thank-you page, etc.).

Create a Custom HTML tag in GTM

Add a new tag, type Custom HTML. Paste: <script>optibaseSendConversionEvent('your-conversion-id');</script> Replace your-conversion-id with the conversion ID from your Optibase dashboard, or with a GTM variable that resolves the right ID dynamically.

Attach the trigger and publish

Attach your trigger to the Custom HTML tag. Test it in GTM Preview mode by performing the action on your site. You should see both the GTM tag fire and the conversion register in Optibase. Submit and publish the GTM container.

Push variant data to the dataLayer (optional)

If you want other tags in your container to read the Optibase variant, add a second Custom HTML tag with a script that pushes the variant info to the dataLayer using window.optibaseAddActiveVariantsListener. Now Facebook Pixel, LinkedIn Insight, and Google Ads can all read the variant as an event property.
What syncs

What gets sent

Field

Direction

Frequency

Sent as

Conversion event

GTM trigger → Optibase

On user action

optibaseSend ConversionEvent('id') JS call

Conversion ID

GTM → Optibase

Per call

Function argument

Variant exposure

Optibase → dataLayer (optional)

On variant exposure

dataLayer push, custom event

Active variants

Optibase script → page-side JS

Real-time

window.optibaseActiveVariants, window.optibaseAddActiveVariantsListener

FieldDirectionFrequencySent as
Conversion event GTM trigger → Optibase On user action optibaseSendConversionEvent('id') JS call
Conversion ID GTM → Optibase Per call Function argument
Variant exposure Optibase → dataLayer (optional) On variant exposure dataLayer push, custom event
Active variants Optibase script → page-side JS Real-time window.optibaseActiveVariants, window.optibaseAddActiveVariantsListener

The flow is bi-directional. GTM events trigger Optibase conversions. Optibase variant data feeds into the dataLayer for downstream tags to consume.

Browse integrations

Optibase integrates with the rest of your stack

Google Analytics 4

The Google Optimize replacement. Variant exposure lands in GA4 as an event parameter, native or via GTM. Build variant-aware audiences for Google Ads remarketing.

Learn more

Mixpanel

Auto-detected. Variant exposure lands as a Mixpanel event with variantId and testId. Works in any Insight, Funnel, Retention, or Cohort.

Learn more

Amplitude

Variant assignment events flow into Amplitude. Skip the Amplitude Experiment seat. Analyze in your existing Amplitude dashboards.

Learn more

PostHog

PostHog Actions detect Optibase data attributes natively. Pair Optibase marketing-page testing with PostHog's product analytics.

Learn more

BigQuery

Service-account auth, batch export of variant assignments, conversions, visitor IDs, and timestamps. Joinable with the GA4 BigQuery export, Stripe revenue, and any other warehouse data.

Learn more

Stripe

Server-to-server attribution that survives Stripe Checkout's domain change. Pass the Optibase user ID via client_reference_id, fire conversions from your webhook, see revenue per variant on every test.

Learn more

MCP Server

Hosted Model Context Protocol server at https://my.optibase.io/api/mcp. Read tests, conversions, heatmaps, and traffic from Claude Desktop, Cursor, or any MCP-compatible client.

Learn more

Custom API

Active Variants API in the browser. Conversion endpoint for server-to-server events. External user IDs. Reverse-ETL flows.

Learn more
FAQ

Frequently asked questions about the GTM integration

How do I trigger an A/B test conversion from Google Tag Manager?
Add a Custom HTML tag in GTM with the script optibaseSendConversionEvent('your-conversion-id') and attach it to your existing GTM trigger (form submit, purchase, click, etc.). The conversion fires on Optibase the moment the GTM trigger fires. No new event taxonomy, no developer required.
Can I use Optibase with server-side GTM?
Yes, the same optibaseSendConversionEvent function works in server-side GTM. If you have moved to server-side for performance or privacy reasons, the integration is the same.
Do I need to write any custom JavaScript?
One line: optibaseSendConversionEvent('your-conversion-id') inside a Custom HTML tag. That is the entire integration. If you want to push variant data to the dataLayer for other tags, that is a second Custom HTML tag with a small listener script, also documented.
Will this conflict with my existing GA4 GTM tags?
No. The Optibase function call runs alongside your other GTM tags. If GA4 is in your container, both Optibase and GA4 fire on the same trigger and both record the conversion in their respective systems.
Can I push variant data to my Facebook or LinkedIn pixels?
Yes. Use window.optibaseAddActiveVariantsListener in a Custom HTML tag to push the active variant into the GTM dataLayer. From there, your Facebook Pixel, LinkedIn Insight Tag, or Google Ads Conversion tag can read the variant as a custom property and use it for retargeting or reporting.
Can the conversion ID be dynamic, based on the page or trigger context?
Yes. Replace the hardcoded ID string in the script with a GTM variable that resolves the right ID at runtime. Useful when one trigger maps to multiple conversion contexts (e.g. different product purchases).
Is the GTM integration available on every Optibase plan?
Yes. Every Optibase integration, including GTM, is available on every plan including the free tier. There is no upgrade or paid feature gate.