Skip to main content

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.

Shown in StoryProof when you copy a widget’s embed code.

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.

  • Problem 2

    Two teams might both add the script

    If a developer also hard-codes the script, pages end up loading it twice.

  • 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.

  • 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.

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.

Which page view trigger for the tag

Trigger order and descriptions from Google’s Tag Manager Help, read on 2026-11-12.
TriggerWhen it firesFor the widget script
Consent InitializationBefore any other trigger, for consent tagsNo
InitializationVery early, before ordinary triggersNo; the div may not exist yet
Page ViewAs the browser starts loading the pageWorks in many cases, but the div may not be parsed yet
DOM ReadyOnce the page HTML is fully builtRecommended: the div is there to fill
Window LoadedAfter images and scripts finish loadingWorks, but testimonials appear later than needed

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

  1. Custom tags, Tag Manager Help. Checked 2026-11-12.
  2. Page view triggers, Tag Manager Help. Checked 2026-11-12.

Last updated 2026-11-12.