Setting up the Onsite Campaign integration
Set up Onsite Campaign by clicking Integrations → List Integrations → Onsite Campaign → Setup Integration → Create New Onsite Campaign.

Fill in the fields. Make sure to enter your domain in the Domain field – i.e. without https:// and without www.
Finish by clicking Save integration.
Implementing the Onsite Campaign script
Go to Integrations → List integrations → Onsite Campaign → Edit integration → ⁝ → Installation guide. You can now choose between Copy both scripts and Copy script to GTM. The latter only works if you deploy the script in GTM (Google Tag Manager). Alternatively, select Copy both scripts and paste them into your site.
Typically, both scripts are inserted in the footer. This way, the scripts will be available on all pages, which means that Onsite Campaigns can be displayed across your entire website. However, if you only want an Onsite Campaign to appear on selected pages, you can choose to implement the scripts only on those specific pages.
Heyloyalty cannot advise on exactly where to implement this on your site, as it depends on your CMS, but the scripts must be inserted in a location that can handle JavaScript.
Next.js – Onsite Campaign
If your website uses Next.js, the Onsite Campaign script will not automatically load on new page views. This is because Next.js often works as a single-page application where the page is not fully reloaded when navigating between different subpages. As a result, Onsite Campaign is not displayed on the website.
To ensure that Onsite Campaigns work correctly in a Next.js setup, you need to implement some specific code elements on your website. Here, you can read what needs to be added to your website for Onsite Campaign to appear.
In this guide, we go through what needs to be set up and how to implement the solution correctly.

If you need information or help that you cannot find here on the guide site, you are always welcome to contact our support!
support@heyloyalty.com