Install guide

Install with Google Tag Manager

Two Custom HTML tags: one on every page for the widget, one on your purchase event for orders. No developer needed if your site already has GTM.

Steps

  1. Add the widget tag

    • In your container, choose Tags › New › Custom HTML.
    • Paste the snippet below and name the tag Vouchernaut.
    • Set the trigger to All Pages.
    Custom HTML, All Pages
    <script async src="https://vouchernaut.com/embed/v1/widget.js" data-key="vn_pk_live_…"></script>
  2. Add the order tag

    If your site pushes GA4 purchase events with ecommerce.transaction_id, value and currency, this tag sends each order to your reports. Make a second Custom HTML tag with a Custom Event trigger for the event name purchase. The two tags can fire in any order: the order waits for the widget.

    Custom HTML, event purchase
    <script>
    window.VouchernautReady = window.VouchernautReady || [];
    window.VouchernautReady.push(function (vn) {
      var layer = window.dataLayer || [];
      for (var i = layer.length - 1; i >= 0; i--) {
        var ecommerce = layer[i] && layer[i].ecommerce;
        if (ecommerce && ecommerce.transaction_id) {
          vn.track("order", {
            id: String(ecommerce.transaction_id),
            total: ecommerce.value,
            currency: ecommerce.currency
          });
          return;
        }
      }
    });
    </script>
  3. Consent

    The widget sets no cookies. It keeps a session id and the shopper's verification in the browser's storage so they aren't asked twice; add data-consent="denied" to the snippet to turn that off, for example until your consent tool has an answer. With Consent Mode, add the tag's consent checks in its Advanced Settings the way your policy treats functionality storage.

  4. Submit and publish

    Use Preview to check the tag fires, then Submit and publish the container.

Check your install

Is the widget on your site?

Open a page with the snippet, then paste the key from it here. We say whether the widget loaded on one of your allowed sites in the last 10 minutes.

It's in your snippet, and on the console's Developers page.