This page exists in one language only. Some pages here are English, some Swedish.
Installing Stockisto via Google Tag Manager
Before you begin
- You have a Stockisto account and at least one retailer imported
- You have edit access to your Google Tag Manager container
- Your website is live
Method 1: Google Tag Manager
Step 1: Copy your GTM tag
In your Supplier Admin, open Install, choose GTM and copy the tag. It wraps the same snippet as the Embed script method, with your saved embed id filled in:
The id below is an example. Use the saved embed id your admin supplies.
<script
src="https://cdn.test.stockisto.com/widget.js"
data-api-base="https://api.test.stockisto.com"
data-embed="we_0123456789abcdef0123456789abcdef"
async></script>
Keep the generated embed id
Leave data-embed and data-api-base as generated. The id identifies your
saved widget, and the API origin is set for your environment.
Step 2: Create a new tag in GTM
- Open Google Tag Manager → Tags → New
- Click Tag Configuration → choose Custom HTML
- Paste your Stockisto tag into the HTML field
Step 3: Set the trigger
- Click Triggering → choose All Pages, or a trigger that matches your product pages
- Click Save and name your tag, for example "Stockisto widget"
Step 4: Preview and check
- Click Preview in GTM and enter your website URL
- Open the page. The locator should render where the tag fires
- Open DevTools → Network and confirm
widget.jsloads, followed by a request toapi.test.stockisto.com/api/v1/locator/widget-embeds/we_...
Where does the widget appear?
A GTM tag injects the snippet at the end of the page, so the locator renders
at the bottom unless your page already has a <div id="stockisto-full">. Place that div where the locator belongs. The
widget renders into it when it exists.
Step 5: Publish your container
- Click Submit in GTM and add a version name, for example "Add Stockisto"
- Click Publish
Method 2: Direct HTML
If you do not use GTM, paste the same snippet into your page template where the locator should appear. Every other guide on this site starts from that snippet.
Copy the saved embed id from your admin's Install panel. Keep data-api-base as generated.
The we_... id identifies the saved widget; changes in the admin reach the snippet on its next load.
New snippets need no slot div. Page keys such as data-sku still come from the current product.
Snippets installed today keep working
Existing snippets with data-stockisto-slug, type and view remain supported. Omitted settings use
the owner's default embed, with the existing attribute behaviour as fallback when that lookup fails.
<script
src="https://cdn.test.stockisto.com/widget.js"
data-api-base="https://api.test.stockisto.com"
data-stockisto-slug="YOUR-BRAND-SLUG"
data-widget-type="where-to-buy"
async></script>
Allow https://api.test.stockisto.com in connect-src and https://cdn.test.stockisto.com in script-src on TEST.
For production use the generated https://api.stockisto.com and https://cdn.stockisto.com origins.
A blocked API connection shows a load-failed state for a named embed; it cannot use cached results.
Allow your domain
In Install → Embed script → Allowed origins, add every domain that hosts the widget, one per
line, such as https://www.yourbrand.com. The widget loads without it. Analytics events and lead
attribution are only credited to your account from a listed origin.
Confirming the install
Back in Install, the Install Health panel reports what your site sends. Click Check now to refresh it.
| Status | Meaning |
|---|---|
| Script detected | The widget has reported in from your site |
| Waiting for first event… | Nothing received yet. Visit a page where the tag fires |
| Issues detected | The script reports in, but something needs your attention |
| Script not detected | No report received from your site |
The panel also lists each widget's last render outcome: rendered, loads but refused, showed nothing, or failed to render.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| "No events received in 24h" | The tag is not firing | Check the GTM trigger and that the container version is published |
| "Script not loading" | The page blocks the CDN script | Allow https://cdn.test.stockisto.com in script-src |
| Widget renders at the page bottom | No container div on the page | Add <div id="stockisto-full"></div> where the locator should appear |
| Locator loads but shows no stores | Retailer data not published | Publish your locator in Supplier Admin |
| "Loads, but refused" | Locator set to Private, or plan gate | Set the locator to Public, or check the widget type against your plan |
| CSP error in the console | Content-Security-Policy blocks the script | Allow https://cdn.test.stockisto.com in script-src and the API in connect-src |
FAQ
Does Stockisto slow down my website?
No. The script loads with async, and it fetches store data only when the widget scrolls into
view.
Can I install on multiple pages?
Yes. Fire the tag on every page where the locator should appear. Most sites use an All Pages trigger and place the container div on the pages that need it.
Can I show a product-specific widget through GTM?
Yes. Use the inline view (data-view="inline" plus data-sku) and fill data-sku from a GTM
variable that reads the product code on the page. The
Integrations & embed guide lists every attribute.
What about a custom domain for my hosted locator?
The GTM tag does not depend on it. The hosted locator's custom domain is set up separately and verified through DNS in the background.