Send feedback

Quickstart: the script tag

One line on every page tracks a website. It works on any site: hand-written HTML, WordPress, Shopify, Wix, Webflow or your own build.

Before you begin#

  1. Sign in, open the Developer page and choose Add a source.
  2. Choose Website and give its domain, for example example.gm. Its subdomains (www.example.gm, shop.example.gm) are included.
  3. Copy the publishable key, which starts with pk_.

Add the snippet#

Put this before </head> on every page, with your key:

HTML
<script async src="https://enterprise.optiq.studio/t.js" data-key="pk_your_publishable_key"></script>

From then on it sends, by itself:

  • a page view on every page, including each move in a single-page site;
  • a form start the first time someone types into a form;
  • a contact when someone presses a WhatsApp, call or email link. Share links are not counted.
Note: The snippet loads after the page and sends with the browser’s beacon, so it never slows a page down or holds one up.

Count your lead forms#

Mark a form with data-optiq="lead". When it is sent, it counts as a lead, with the email or phone in it hashed in the browser:

HTML
<form name="consultation" data-optiq="lead">
  <input type="email" name="email">
  <input type="tel" name="phone">
  <button>Send</button>
</form>

If your form is sent by JavaScript and can fail, count the lead yourself once it succeeds:

JavaScript
optiq("track", "lead", { form: "consultation", email: form.email.value });

Count a sale or a deposit#

One line, where it happens:

JavaScript
optiq("track", "purchase", { value: 1500, currency: "GMD" });
optiq("track", "first_deposit", { value: 500, currency: "GMD", email: customer.email });
Key point: A browser can be switched off or edited. For money, send the event from your server as well: see Send events from your server. Give both the same id and the event counts once.

Calls before it loads#

The snippet loads in the background. To call optiq() before it arrives, put this one line above it. Calls wait and run in order, and a consent choice among them applies from the first page view:

HTML
<script>window.optiq=window.optiq||function(){(window.optiq.q=window.optiq.q||[]).push(arguments)};</script>

Check it works#

  1. Open your site in a browser, as a visitor would.
  2. On the Developer page, your source’s line changes from Nothing received yet to the time of its latest event, and the event appears under Latest events.
  3. If a page on another address uses the key (a test copy, for example), the source shows a warning that names it.
Caution: If your site has a content security policy, allow https://enterprise.optiq.studio for scripts and https://optiq-collect-951694748196.europe-west2.run.app for connections.

Last updated 2026-11-04 UTC. The SDK is open source under the MIT licence. Tell us what is missing.