Skip to content

Installation

Bluestars loads from one script tag. Add it once, sitewide: ideally in the <head>, or just before the closing </body>.

<!-- Bluestars -->
<script
async
src="https://bluestars.app/widget/bluestars.js"
data-tenant-id="00000000-0000-0000-0000-000000000000"
></script>

Replace the data-tenant-id value with your own tenant ID (find it in your dashboard). That’s the whole integration: everything else is configured from the dashboard, not in code.

Do not paste the script tag above into Google Tag Manager. Tag Manager rebuilds a pasted script tag without its data- attributes: the widget still loads, but it does not know which account it belongs to and measures nothing. In a Custom HTML tag, use this code instead, which creates the script tag itself:

<script>
(function () {
var s = document.createElement("script");
s.async = true;
s.src = "https://bluestars.app/widget/bluestars.js";
s.setAttribute("data-tenant-id", "00000000-0000-0000-0000-000000000000");
document.head.appendChild(s);
})();
</script>

Replace the tenant ID with your own; your dashboard shows this code ready to copy on the Via Google Tag Manager tab. Fire the tag on All Pages and publish the container. No other settings are needed. If Tag Manager already holds a Bluestars tag, replace it with this one.

Seeing [BluestarsAssistant] Missing data-tenant-id in the browser console? Then the plain script tag is still in Tag Manager.

Your dashboard shows your site’s main address under Account > Settings > Website. That is where we check that the script is in place. Measurements count on every domain listed under Domains (and their subdomains). If your site runs on a different address, change it there; yoursite.com without https:// works too. If your site runs on several domains, add them under Domains.

AttributeRequiredDescription
data-tenant-idYesYour tenant UUID. Without it the widget logs a warning and does nothing.
data-api-urlNoOverride the API origin. Defaults to the origin the script was loaded from. Only needed for custom setups.
asyncRecommendedLoads without blocking page rendering.
  1. The script waits for the DOM to be ready.
  2. Bots are skipped: crawlers and headless agents never trigger the widget.
  3. It fetches your published configuration and resolves the visitor’s BSR segment.
  4. It applies the segment class and counts the visit in your statistics.
  5. If the URL carries a survey link (?campaign=<slug>), the survey opens at its placement, or as a popup if none matches.

The widget also runs a MutationObserver for ~10 seconds after load, so it still attaches correctly on pages that inject content late (sliders, hydration, SPA navigation).

A survey renders inside a Shadow DOM. Your site’s CSS cannot leak into the widget, and the widget’s CSS cannot leak into your site. You never need to worry about class-name collisions or specificity wars.

Open your site with ?bs=1 appended to the URL (e.g. https://your-site.nl/?bs=1) and open the browser console. In preview mode the widget logs the resolved BSR color, so you can confirm the script is loading and reaching the API.