Platform Setup4 min read

How to Add FloatMessage via Google Tag Manager

If you already use Google Tag Manager (GTM) to manage scripts on your website, you can add FloatMessage without touching your site's code. This guide walks you through setting up a Custom HTML tag in GTM.

1

Sign up and create your first message

Go to floatmessage.com/login and sign in with Google. You'll get a 30-day free trial with full access — no credit card required.

In the dashboard, click Messages in the sidebar, then New Message. Pick a template, customize it, and save.

FloatMessage dashboard showing the message editor with template selection and HTML/CSS editing
Create and customize your message in the dashboard
2

Copy your embed code

Go back to your Dashboard home page and copy the embed snippet shown there. You'll need this in the next step.

FloatMessage dashboard showing the embed snippet with User ID
Copy the embed snippet from your dashboard
3

Open Google Tag Manager

Log in to tagmanager.google.com and select the container for the website where you want to add FloatMessage.

4

Create a new Custom HTML tag

In the left sidebar, click Tags, then click New.

  1. Name the tag something descriptive, like FloatMessage Embed.
  2. Click Tag Configuration and choose Custom HTML.
  3. Paste the FloatMessage embed snippet into the HTML field:
<script>
  (function() {
    var s = document.createElement('script');
    s.src = 'https://floatmessage.com/embed/floatmessage.js';
    s.setAttribute('data-user', 'YOUR_USER_ID');
    s.async = true;
    document.head.appendChild(s);
  })();
</script>
Tip: Replace YOUR_USER_ID with the actual User ID from your FloatMessage dashboard embed snippet. This self-executing script is required for GTM — regular <script src> tags don't work inside GTM Custom HTML tags.
5

Set the trigger to All Pages

Under the tag configuration, click Triggering and select All Pages. This ensures FloatMessage loads on every page of your site.

Note: If you only want FloatMessage on specific pages, create a custom trigger with a Page URL condition instead. For example, you can trigger only on pages matching /pricing or /checkout.
6

Save and publish

Click Save on the tag, then click Submit in the top right corner of GTM. Add a version name like "Added FloatMessage" and click Publish.

Tip: Use GTM's Preview mode before publishing to test that the tag fires correctly. You should see the FloatMessage script loading in the tag assistant.
7

Verify on your site

Open your website in a browser. Your floating message should appear based on the trigger you configured in the FloatMessage dashboard (immediately, on scroll, after a delay, or on exit intent).

Note: If you don't see anything, make sure the message is set to Active in the FloatMessage dashboard and that GTM has finished publishing. It may take a few minutes for the new tag to go live.

Loading specific messages

Instead of loading all messages by User ID, you can load specific messages by their ID. Use the Copy ID button next to each message in your dashboard, then use data-id instead:

<script>
  (function() {
    var s = document.createElement('script');
    s.src = 'https://floatmessage.com/embed/floatmessage.js';
    s.setAttribute('data-id', 'MSG_ID_1,MSG_ID_2');
    s.async = true;
    document.head.appendChild(s);
  })();
</script>