Landing pages and funnels
Add Loogika to Unbounce
You add Loogika to Unbounce with Script Manager. One script there covers all pages of a domain, and pages published afterwards get it too. For one Classic Builder page on its own, the Javascripts dialog of that page does the job.
Last updated .
What do you need before you start?
Copy your script tag from Site Settings in Loogika, under the Tracking Script tab. It looks like this, with your own 12-character site ID in place of YOUR_SITE_ID:
<script src="https://app.loogika.com/api/script.js?siteId=YOUR_SITE_ID" defer></script>
Custom scripts are not available on the Unbounce Starter plan. You need the Build plan or a higher one. A connected custom domain is a second requirement for Script Manager. Pages on the test domain unbouncepages.com are outside its reach.
How do you add Loogika with Script Manager?
Create a custom script with the placement Head and tick the domains it should cover.
- Open Settings from the menu on the left and choose Script Manager.
- Click Add a Script, pick Custom Script and type a name. Click Add Script Details to continue.
- For Placement choose Head. For Included on choose All, which covers main pages and confirmation dialogs.
- Paste the tag into the editor.
- On the right, tick each domain that should load the script. Finish with Save Changes.
All pages on the ticked domains now load the script, and so does any page you publish there afterwards. Republish a page if it does not pick the script up.
How do you add Loogika to one Classic Builder page?
Use the Javascripts dialog in the Classic Builder. Smart Builder pages have no script dialog at page level, so use Script Manager for those.
- With the page open in the Classic Builder, find Javascripts in the bottom left corner and click it.
- Name the script and choose Head for Placement.
- Paste the tag and click Done.
- Click Save, then Publish or Republish.
How do you track form submissions in Unbounce?
After Unbounce records a lead, it runs the functions registered in window.ub.hooks. Treat that hook as unofficial. Add the code below as a second script in Script Manager, or as a page script. Set its placement to Before Body End Tag.
<script>
window.ub.hooks.afterFormSubmit.push(function () {
if (window.loogika) {
window.loogika.event("lead", {
page: window.ub.page.name,
variant: window.ub.page.variantId
});
}
});
</script>
Each submission arrives in Loogika as an event named lead, and its properties hold the page name and the variant. Three values exist on every Unbounce page: window.ub.page.name, window.ub.page.variantId and window.ub.page.id. The variant on each event lets you compare A/B variants in Loogika.
How do you check that Loogika is installed?
Open the published page in a new tab. Unbounce runs custom scripts on the published page only, so the builder and Preview send nothing. The pageview shows up in the Loogika dashboard within a few seconds. If nothing arrives, open the page source and look for script.js?siteId=.
Why does Unbounce not send data to Loogika?
| Symptom | Cause and fix |
|---|---|
| Each pageview is counted twice | The tag sits both in Script Manager and on a single page. Remove the copy on the page and keep the one in Script Manager |
Nothing arrives from unbouncepages.com | Only custom domains are covered by Script Manager. For a test on the Unbounce test domain, put the tag on the page itself |
| Script Manager is missing from Settings | Custom scripts are not part of the Starter plan that the account uses |