Skip to content

Track Conversions with Google Tag Manager (GTM)

If you manage your website tags through Google Tag Manager, this is the easiest way to report a conversion back to Rose — no changes to your website code required.

You add one tag that fires when a visitor submits one of your forms. The tag calls Rose's trackFormSubmitted() API, which records the same conversion event Rose logs for forms it detects automatically. This lets the submission count in your Rose conversion metrics and attribution.

When to use it

Rose already detects most form submissions automatically. Reach for the GTM tag when:

  • Rose cannot auto-detect your form — for example a custom JavaScript form, a single-page app, or a third-party embed Rose can't observe.
  • You prefer managing all tracking in one place (GTM) instead of editing your site.
  • You want a conversion to fire on a specific success signal you already track in GTM (a thank-you page view, a dataLayer event, etc.).

What Rose receives

This reports the conversion event — that a form was submitted — together with an optional form label. It does not send the submitted field values (email, company, …) to Rose. To get lead data into Rose, see HubSpot or Webhooks.

Before you start

You need:

  1. The Rose widget installed on the page where the form is submitted (loaded via GTM or directly).
  2. A GTM container on your site.
  3. A GTM trigger that fires when your form is submitted successfully — for example the built-in Form Submission trigger, a Custom Event your form pushes to the dataLayer, or a thank-you Page View.

Setup

Step 1 — Create the trigger

Create (or reuse) a trigger that fires only on a successful submission. Common choices:

Your form Recommended trigger
Standard HTML <form> Built-in Form Submission trigger
Custom JS / SPA form Custom Event trigger matching the event your form pushes to the dataLayer
Form that redirects after submit Page View trigger matching your thank-you / confirmation URL

Fire on success only

Make sure the trigger fires only when the submission succeeds. Firing on every click or every submit attempt inflates your conversion numbers.

Step 2 — Create the tag

In GTM, create a new tag with type Custom HTML and paste:

<script>
  (function () {
    if (
      window.InboundXWidget &&
      typeof window.InboundXWidget.trackFormSubmitted === 'function'
    ) {
      window.InboundXWidget.trackFormSubmitted({ formId: 'demo-request' });
    }
  })();
</script>
  • The if guard makes the tag a safe no-op if the Rose widget hasn't finished loading — it never throws an error.
  • formId is optional. Set it to a short label (e.g. demo-request, contact, newsletter) so you can tell several forms apart in your analytics. Calling trackFormSubmitted() with no arguments also works.

Step 3 — Attach the trigger and publish

Assign the trigger from Step 1 to this tag, then Submit / Publish your GTM container.

Optional: one tag for several forms

If you have many forms and want a single reusable tag, read the form label from a GTM variable (for example a Data Layer Variable) instead of hardcoding it:

<script>
  (function () {
    var formId = '{{Form ID}}'; // a GTM variable holding your form label

    if (
      window.InboundXWidget &&
      typeof window.InboundXWidget.trackFormSubmitted === 'function'
    ) {
      window.InboundXWidget.trackFormSubmitted({ formId: formId });
    }
  })();
</script>

GTM replaces {{Form ID}} with the variable's value when the tag fires. Keep the quotes around '{{Form ID}}' so the result is always a valid string.

Verify it works

  1. In GTM, open Preview mode and load your site.
  2. Submit a test form.
  3. Confirm your tag fired in the GTM Preview panel on the submission event.

Once published, new conversions appear in your Rose reporting. Ask your Rose account manager if you'd like help confirming the events are landing.

Good to know

  • Reports the event, not the data. Rose learns that a conversion happened, not who converted. Pair this with Conversion Tracking to capture the Rose session ID in your CRM for full lead attribution.
  • Avoid double counting. Make sure only one mechanism reports each submission. If Rose already auto-detects a form, you don't need a GTM tag for it too.
  • Timing. The Rose widget loads in the background. If a visitor submits extremely fast — before the widget is ready — the guarded tag simply does nothing for that submission, which is rare in practice.