Google Tag Manager attribution template
Import Hoko's customer-owned browser attribution template with explicit consent.
What this guide covers
This is a customer-imported Google Tag Manager custom template. It loads the fixed public script https://hoko.to/analytics.js after an explicit consent gate. It is a recipe, not a native Google OAuth connection or a template gallery listing.
Download the template or inspect the template source. Keep the file in the customer-owned container workflow. Hoko has not verified a provider container or published this template to a gallery.
Configure consent
Set the required template input to:
explicitAnalyticsConsent: trueMap that boolean to the site's consent management platform. The template fails closed for false, an unset value, or any non-boolean value. Do not treat an unset GTM consent type as explicit consent.
The template requests only GTM's sandboxed script injection permission. It does not request a provider credential, cookie access, local-storage access, global reads, data-layer reads, or server network access.
Load the fixed script
The template injects exactly:
https://hoko.to/analytics.jsThe ordinary script reads an existing hoko_id from the current query or cookie and persists that identifier. It does not create an embedded click, send analytics events, or expose a second click identifier. Keep the separate /{shortId}/analytics.js embedded-click capability out of this template.
Import and preview
Import the file into a customer-owned GTM container. Preview the tag with consent denied, consent unset, consent granted, and no existing hoko_id. Check that the fixed URL is the only script loaded and that repeated firing does not create another click.
Publishing requires the customer's container approval and remains an external verification gate. Do not report the template as provider-verified until an authorized disposable GTM container records import, Preview, consent, repeat-fire, and cleanup evidence.
See GTM's sandboxed JavaScript API and template permissions for the host contract.
Remove the template
Remove the template and its tags from the customer-owned container, then restore the previous container state. The Hoko public script and existing cookie behavior remain unchanged.