Google Tag Manager
Install Logspot through Google Tag Manager with a Custom HTML tag — no code changes to your site.
If your site already runs Google Tag Manager (GTM), you can add Logspot without touching your codebase.
1. Create a Custom HTML Tag
In your GTM workspace: Tags → New → Tag Configuration → Custom HTML, and paste:
<script
src="https://cdn.logspot.io/lg.js"
data-logspot-pk="YOUR_PUBLIC_KEY"
></script>Find your public key in Project settings.
2. Fire It on Every Page
Under Triggering, choose All Pages (the built-in Initialization - All Pages trigger is ideal so Logspot loads before other tags). Save.
The script auto-captures pageviews, so after you Submit / Publish the container, pageviews start flowing immediately.
3. Track Custom Events (Optional)
To send a Logspot event from a GTM trigger (e.g. a button click or a dataLayer event), add another Custom HTML tag:
<script>
// `window.Logspot` is available once the Logspot tag has loaded.
window.Logspot &&
window.Logspot.track({
event: 'NewsletterSignup',
metadata: { source: 'footer' },
});
</script>Attach it to whatever GTM trigger represents the action (click, form submission, custom dataLayer event). Use Tag Sequencing so the Logspot library tag fires first.
Prefer a no-tag approach? Add the
lgspt-class convention to your buttons (e.g.class="lgspt-sign-up") and Logspot captures the click as aSign Upevent automatically.
Verify It's Working
Use GTM Preview mode to confirm the tag fires, then open the Logspot dashboard — events appear within seconds.