Install with Google Tag Manager
Install the agent's tag and report orders and add-to-carts from Google Tag Manager, on every platform except Shopify. Import the Main Tag and Sales templates, create the two tags, test them with Preview, publish, and fix what goes wrong.
On every platform except Shopify, you can install the agent from your Google Tag Manager (GTM) web container instead of pasting code into your store. iAdvize gives you two GTM templates, downloaded from Site settings > Installation:
| Template | What its tag does | Where it fires |
|---|---|---|
| iAdvize - Main Tag | Installs the agent's tag, exactly as the install snippet does. Its one field, Site public key, is already filled in with your site's key. | On every page, when the page has finished loading. |
| iAdvize - Sales | Reports each completed order with the transaction command and each product added to the cart with the addToCart command. | On your store's purchase and add-to-cart dataLayer events. |
You need both. The Sales tag does not send anything itself: it hands each order and each add to the agent's tag, which sends them. On a page where the agent's tag is not installed, the Sales tag records nothing. So the Main Tag (or the snippet) must run on every page where the Sales tag fires, the order confirmation page included.
The order in which they fire does not matter. When the Sales tag fires before the agent's tag has loaded, its calls wait in the tag's queue and are sent once the tag loads.
On Shopify, use the Shopify guide instead: the snippet in your theme and the Shopify pixel.
Before you start
- Your GTM web container runs on every page of your store, the order confirmation page included.
- You can see the install snippet on Site settings > Installation. The same members can download the two templates.
- For the Sales tag, your store pushes its orders and add-to-carts to the dataLayer. The template reads the GA4 ecommerce format (
purchaseandadd_to_cartevents) by default. Another format works too: you map it in the template, with no code (see If your dataLayer is not in the GA4 format).
If the install snippet is already in your pages, the Main Tag sees it and loads nothing more, so the agent's tag never loads twice. The snippet's key is the one used.
Download the templates
Open the site in the dashboard and go to Site settings > Installation:
- the Install the tag card downloads the Main Tag template, with your site's public key already filled in;
- the Track your sales card downloads the Sales template. It carries no key, so the same file works for every site.


Import a template
Do this once per container for each template.
In Google Tag Manager, open your container and go to Templates. Under Tag templates, click New.
In the More actions menu (the three dots at the top right), choose Import, then pick the .tpl file you downloaded.

Click Save. The template now shows under Tag templates as iAdvize - Main Tag or iAdvize - Sales.
Create the Main Tag
Go to Tags and click New.
In Tag configuration, pick iAdvize - Main Tag. The Site public key field already holds your site's key (pk_site_…). Do not change it. Once the tag is saved, the card only shows the template's name: click it to see the field again.

In Triggering, choose a Window Loaded trigger that fires on all pages. A new container has none: All Pages is a Page View trigger, which fires as soon as the page starts loading, not a Window Loaded one. To create it, click + in Firing Triggers, then + at the top right of the list, then Trigger Configuration, and pick Window Loaded in the Page View group: the trigger type reads Page View - Window Loaded. Under This trigger fires on, keep All Window Loaded Events. Name it (for example "Window Loaded - All pages"), save it, and it is added to the tag.

Save the tag. Then test and publish.
Why Window Loaded. The install snippet waits for the page's load event before it loads anything, so the agent's tag never competes with your page's first render. A GTM template cannot wait for that event itself, so the trigger does the waiting. All Pages fires earlier, while your page is still loading: don't use it for the Main Tag.
Create the Sales tag
Install the Main Tag first: without it, the Sales tag records nothing.
Go to Tags and click New.
In Tag configuration, pick iAdvize - Sales. If your dataLayer uses the GA4 format, leave My dataLayer does not use the GA4 format unticked: there is nothing to fill. Otherwise, see If your dataLayer is not in the GA4 format.

In Triggering, add two Custom Event triggers, one for your purchase event and one for your add-to-cart event. In Google Tag Manager a tag runs only when one of its triggers fires: the Sales tag does not watch the dataLayer by itself. A Custom Event trigger fires each time your site pushes an event of that name to the dataLayer, so with these two triggers the Sales tag runs at each purchase and each add to cart, and at no other moment. The moment the agent's tag loads is the Main Tag's trigger, not this one. For each: click + in Firing Triggers, then + at the top right of the list, then Trigger configuration, pick Custom Event, enter the event name (purchase, then add_to_cart), name the trigger and save it. If a trigger for that event already exists in your container (for GA4, for example), add it instead of creating a new one.
If your store pushes other names (purchase_custom, for example), use those names in the triggers, and the same names in the tag's mapping (see below). The two must match: the tag compares the name of the event that fired it with the names in its mapping, and on any other name it runs but sends nothing.

Save the tag. Then test and publish.
One tag handles both events: it reads the name of the event that fired it. On the purchase event, it reports the order. On the add-to-cart event, it reports each product line added, one add per line. Any other event sends nothing.
What the Sales tag reads in the GA4 format
| Event | Values read when the tag fires |
|---|---|
purchase | ecommerce.transaction_id (the order reference), ecommerce.value (the amount), ecommerce.currency, and the lines in ecommerce.items |
add_to_cart | ecommerce.currency and the lines in ecommerce.items, each with item_id, item_variant, quantity and price. A line with no quantity counts as one unit. |
Push ecommerce: null before each GA4 event, as Google recommends, so a value left over from an earlier event is never read.
The tag reads nothing else from the dataLayer: no email, no name, no address, no cookie. The tag hands the order's lines to the agent's tag, which does not send them yet: only the order total is recorded (see Limits).
If your dataLayer is not in the GA4 format
Tick My dataLayer does not use the GA4 format. Two sections appear, Purchase and Add to cart, each with:
- the event name, prefilled with the GA4 name (
purchase,add_to_cart). Use the same names in the trigger; - the values: for a purchase the order reference, amount, currency and products; for an add to cart the currency and the products added. Left empty, a field reads its GA4 key. To read your own key, put a GTM variable in the field, for example a Data Layer Variable that points to it;
- the line keys: the names of the product id, variant, quantity and unit price keys in each product line (plus the unit discount for a purchase), prefilled with the GA4 names. Each event has its own, so a store whose two events describe products differently is covered.

The order amount can be a number or a decimal string. A comma works as the decimal separator only when it is the only separator and one or two digits follow it: 59,90 is read as 59.90, while 1,234 is refused, never guessed. The other rules on each value are those of the transaction command and the addToCart command.
Your container now holds the two tags, each with its triggers:

and three triggers, each used by one tag:

Test and publish
In your workspace, click Preview (top right). Tag Assistant opens: enter the address of a page of your store and click Connect. Your store opens in a new window, with this container's unpublished changes. It works only on a site where this container is already installed (the Google Tag Manager snippet in its pages).
Browse a page, add a product to the cart and place a test order. If your store does not push its add_to_cart and purchase events yet, you can push one by hand to check the Sales tag: in the store window, open the browser's console and run, for example, dataLayer.push({ ecommerce: null }); dataLayer.push({ event: 'add_to_cart', ecommerce: { currency: 'EUR', items: [{ item_id: 'TEST-1', quantity: 1, price: 10 }] } }). That add is recorded like a real one. In Tag Assistant, check that iAdvize - Main Tag fired on the Window Loaded event, and that iAdvize - Sales fired on your purchase and add-to-cart events.

On the Window Loaded event, only the Main Tag fires: the Sales tag waits for a purchase or an add to cart. Click iAdvize - Sales to see the events it fired on and its triggers:

When both tags fire as expected, click Submit, then Publish. Nothing reaches your shoppers until the container is published.
A test order counts like a real one, and there is no way to delete it. Use a low amount, or a site you keep for testing.
Check it in the dashboard
On Site settings > Installation, the Track your sales card shows two rows, Orders received and Add-to-carts received. Each one reads that nothing was received yet until the first order or add arrives from your store, then the date and time of the latest one. When Record orders from your store or Count add-to-carts on your pages is off, its row says recording is off: switch it back on in Site settings > Site access (see The two switches).
The same times are in Get a site's storefront activity (lastStorefrontOrderAt, lastStorefrontAddAt) and the MCP tool get_storefront_activity.
How the tag status sees a Google Tag Manager install
The tag status on the Install the tag card comes from an hourly check of
your homepage. It does not run JavaScript: it looks for your site key in the
HTML your server sends and, when that page loads a GTM container from
www.googletagmanager.com, in that container's script, where the Main Tag
keeps your key. The key appears there once the container is published: a
tag that only exists in your workspace shows in Preview, not in the check. A
container served from your own domain (server-side tagging) is not read, so
the status reads Cannot verify. See How the check
works.
After you rotate the site key
Rotate key on the Site key card stops the old key at once, so the Main Tag stops working until it carries the new one. In GTM, open your Main Tag, replace the Site public key with the new key shown on the Site key card, save, then submit and publish the container.
A Main Tag template downloaded after the rotation carries the new key, but importing it only fills in the key of the tags you create from it afterwards. A tag you already saved keeps the key it was saved with until you edit it.
The Sales tag carries no key: it needs no change.
Troubleshooting
Without Google Tag Manager
Paste the install snippet and call the transaction and addToCart commands in your store's templates. See Install without Google Tag Manager.
Send orders from a server
Report completed orders to the agent with one HTTP request per order, from your server or order system. The contract of the public orders endpoint, how to send the conversation key, what it ignores and what it never tells you.
Install without Google Tag Manager
Install the agent and report orders and add-to-carts by hand, on every platform except Shopify, for a store with no Google Tag Manager. Paste the install snippet, call the transaction and addToCart commands, then check it in the dashboard.