Documentation menuWebsite builders: Webflow

Website builders

Add Loogika to Webflow

You add Loogika to Webflow by pasting the script tag into Head code under Site settings, then Custom code. That covers every page of the site. Webflow can also take the tag on a single page, and both ways need a publish before the tag is live.

Last updated .

What do you need before you start?

Copy your script tag from Site Settings in the Loogika dashboard, under the Tracking Script tab. The tag you copy has your own site ID, a 12-character string, in place of YOUR_SITE_ID:

<script src="https://app.loogika.com/api/script.js?siteId=YOUR_SITE_ID" defer></script>

How do you add Loogika to the whole Webflow site?

Site-wide head code is the right choice for most sites, because every page gets the tag from one setting.

  1. In your project, open Site settings and choose Custom code.
  2. Paste the tag into Head code.
  3. Click Save, then publish the site.

How do you add Loogika to a single Webflow page?

The page settings are the place for the tag when only some pages should be tracked.

  1. In the Designer, find the cog icon beside the name of the page and click it to open the page settings.
  2. Go down to Custom code. The field for code inside the <head> tag takes the Loogika tag.
  3. Click Save, then publish the site.

How do you check that Loogika is installed?

Load the published site in a fresh browser tab and visit a few pages. The pageviews show up in the Loogika dashboard within a few seconds.

The Designer preview is not a valid test, because Webflow holds custom code back until you publish. Test on the published site. If the tag is in the live page source and no data arrives, see the script troubleshooting page.

How do you track a button click in Webflow?

Give the element an ID and attach a click listener that calls window.loogika.event(). You set the ID in the Designer, in the Settings panel under General.

Paste the script below into Footer code under Site settings, then Custom code. An Embed element on the same page works as well. Replace my-special-button with the ID of your element.

<script>
  document.addEventListener("DOMContentLoaded", function () {
    var button = document.getElementById("my-special-button");
    if (!button) return;
    button.addEventListener("click", function () {
      window.loogika?.event("button_click", {
        button_id: "my-special-button",
        page_path: window.location.pathname,
      });
    });
  });
</script>

A script that reads elements from the page belongs in Footer code, not Head code. The elements then exist when the script runs. The page about custom events explains event names and properties.

Can you track Webflow form submissions?

Yes, with the same pattern. Listen for the submit event of a Form Block and send a Loogika event from the listener.

Webflow handles the form submission itself. The Loogika event therefore fires when the visitor tries to submit, not when Webflow confirms that the submission succeeded.

Why do Webflow interactions produce only one pageview?

Loogika records a pageview when the URL changes. A Webflow interaction that shows or hides a section leaves the URL as it is, so the visit counts as one pageview.

Track those states as custom events. Your own script can also call window.loogika.pageview() at the moment a section appears.