Connect a Conversion

If you using Webflow, then you should follow the guide here: Optibase Webflow App

Once you’ve created a Conversion inside the Optibase web app, you’ll need to connect it to your website so Optibase can track when it happens.

Why connection matters

Some conversion types (like clicks and form submissions) rely on being linked to specific HTML elements.

Others (like page views or scroll depth) work based on the URL alone and don’t need any extra setup in your code.


Click Event

If you want to trigger a conversion when a user clicks an HTML element (like a button or link), you need to:

  1. Go to the Conversions page in the Optibase app

  2. Find the Click Conversion you created

  3. Copy the data-optibase-click-conversion-id from the table

  4. Add that attribute to the element on your website

Before:

<button>Sign Up</button>

After:

<button data-optibase-click-conversion-id="sign_up">Sign Up</button>

This tells Optibase to fire the “sign_up” conversion when this element is clicked.


Submit Event

If you want to trigger a conversion when a user submits a form, follow the same steps, but use the data-optibase-submit-conversion-id attribute:

  1. Copy the ID from your Submit Conversion in the dashboard

  2. Add it to the <form> element

Before:

<form>
  ...
</form>

After:

<form data-optibase-submit-conversion-id="sign_up">
  ...
</form>

Optibase will now send a conversion event when the form is submitted.


Programmatic Conversion

This type of conversion is triggered via JavaScript or your backend, not by clicking or submitting elements.

Use this when:

  • You need full control over when a conversion is triggered

  • The conversion happens outside the DOM (e.g. Stripe payment, API response)

Trigger it using:

optibaseSendConversionEvent('sign_up')

You can set up a Programmatic Conversion with Google Tag Manager: Trigger Conversions with GTM

You can also trigger this conversion from the server: Server-side Conversions

Page View, Scroll Depth, and Time on Page

These conversion types do not require any changes to your HTML.

They work automatically based on the URL and settings you define when creating the conversion:

  • Page View: Fires when the page loads

  • Scroll Depth: Fires when the user scrolls to a certain depth

  • Time on Page: Fires after the user spends a set amount of time on the page

Just make sure the script is installed, and Optibase handles the rest.

Last updated