Google Tag Manager
Testimonial Widgets Through Google Tag Manager
If marketing controls Google Tag Manager but not the site’s templates, GTM can load the StoryProof script through a Custom HTML tag. It cannot place the widget: the div that marks where testimonials appear still has to be in the page HTML. Fire the tag on DOM Ready, test it in Preview, then publish the container.
- The Custom HTML tag content, ready to paste
- The div your developer adds once
- Choosing between Page View and DOM Ready
Code generator
The tag and the div
Enter the widget id. Part 1 is the only code that goes into GTM. Part 2 must be added to the page HTML where testimonials appear; GTM does not place it for you.
Part 1 · A Custom HTML tag in your GTM container
Tags › New › Tag Configuration › Custom HTML › HTML field
<script src="https://app.storyproof.io/embed.js" async></script>Part 2 · In the page HTML, added by whoever edits the site
Page template or CMS content › where the widget should render
<div data-storyproof-widget="YOUR_WIDGET_ID"></div>Set the trigger to DOM Ready on the pages that hold a widget div, open Preview to confirm the tag fires there, then Submit and publish the container.
The code is generated here in your browser and not sent anywhere.
The problem, solved
Why teams reach for GTM, and how StoryProof fits it
- Problem 1
Every script waits for the next release
When developers own the templates, adding a third-party script means a ticket, a review and a deploy window.
How StoryProof solves it
The StoryProof script is a single async line, which fits a Custom HTML tag. Only the short div needs a developer, once per placement.
- Problem 2
Two teams might both add the script
If a developer also hard-codes the script, pages end up loading it twice.
How StoryProof solves it
One copy per page fills every StoryProof div on it. Agree that GTM owns the script and the site owns the divs.
- Problem 3
Different pages need different testimonials
Pricing, product and careers pages each want their own kind of proof, and GTM tags are no place to manage that.
How StoryProof solves it
Each div carries its own widget id, and you choose the approved testimonials per widget in StoryProof. The GTM tag stays the same for all of them.
- Problem 4
There is no div on that page yet
A tag can load the script anywhere, but with no div there is nothing to fill, and the page shows no testimonials.
How StoryProof solves it
Until a developer adds the div, link to your hosted Wall of Love from content you can already edit.
In StoryProof
Set it up in Google Tag Manager
Step 1 of 4
Get the div onto the page
Send Part 2 to whoever edits the page template or content and ask for it where testimonials should appear. Confirm it in the page source.
Step 2 of 4
Create the Custom HTML tag
In GTM, click Tags, then New, then Tag Configuration, and choose Custom HTML. Paste Part 1 into the HTML field, keeping the script tags around it. Leave Support document.write off.
Step 3 of 4
Choose the trigger
Add a DOM Ready trigger, which fires after the browser has built the page HTML, and limit it to the pages that hold a widget div, for example by page path.
Step 4 of 4
Preview, then publish
Open Preview, visit a page with a widget and check that the tag fired and testimonials appear. Then submit and publish the container version.
Which page view trigger for the tag
Before you start
What GTM cannot fix
GTM does not place the widget
The tag only loads the script. Where testimonials render is decided by the div in the page HTML, which GTM is not the right tool to manage.
Blocked containers mean no widget
If a visitor’s content blocker stops the GTM container, every tag in it is skipped, including this one. A hard-coded script avoids that dependency.
Consent settings apply to it
If your container holds tags until consent, the widget script waits too. Decide with whoever owns consent whether testimonial display belongs in that group.
GTM rewrites your code slightly
Google notes that Tag Manager minifies Custom HTML tags and may change single quotes to double quotes. The StoryProof line is unaffected, but do not be surprised when it looks different.
Badge and docs date
Widgets show a small StoryProof badge until Pro. GTM steps follow Google’s Tag Manager Help as read on 2026-11-12 and have not been tried in a live container.
FAQ
Questions people ask
Short answers to what usually comes up next.
Can GTM insert the div as well?
A Custom HTML tag could add elements with your own JavaScript, but that places visible content from a tag manager, which is fragile when templates change. Keep the div in the page.
Should the tag fire on All Pages?
Only if most pages have a widget. Otherwise limit the trigger to the pages that do, so other pages do not load a script they will not use.
The tag fired in Preview but no testimonials show. Why?
Check the page source for the div and that its widget id matches the widget in StoryProof. A missing or mistyped div is the usual cause.
Does this work with server-side GTM?
This page covers the web container, which runs in the visitor’s browser. Server-side tagging is set up differently and is not covered here, so use a web container for the widget script.
Still have a question? Ask the StoryProof team or book a demo.
Ship testimonials without waiting for a release
Approve testimonials in StoryProof, load the script from GTM and ask for one div.
Sources
- Custom tags, Tag Manager Help. Checked 2026-11-12.
- Page view triggers, Tag Manager Help. Checked 2026-11-12.
Last updated 2026-11-12.