Installing BirunX with Google Tag Manager

Two ready-made tags that capture the Google ad click ID and tie it to the order it produced.

Before you start

This guide assumes you have a Google Tag Manager account and that a GTM container is already installed on your store. If it isn't, install it from your store platform first and then come back.

  • Publish permission on the GTM container.
  • Your BirunX store ID: it is at the top of the dashboard's side menu, with a copy button next to it.
  • A purchase event in the dataLayer, or a stable order-confirmation page a trigger can attach to.
The store ID is a public identifier, like a Google Analytics measurement ID, and it is meant to be visible in your store's page source. It is not a password and does not need hiding.

Get the two tag files

BirunX ships as two Google Tag Manager tag templates. Download the two files below and import them into your container — the next two sections walk through every click, and a tag imported from a file works exactly as it is with no further setup.

Download the All Pages tagDownload the Purchase tag
For developers: the same two files are also published on GitHub, at github.com/Turki-birunxprofit/BirunX_GTM_Tag_AllPages and github.com/Turki-birunxprofit/BirunX_GTM_Tag_Purchase. The downloads above carry the same content.

Add the All Pages tag

This tag runs on every page and captures the click ID Google adds to the URL when a visitor arrives from an ad. Without it we cannot tie an order back to the ad it came from.

  1. In your GTM container, go to Templates, and in the Tag Templates box press New. The template editor opens.
  2. Open the three-dot menu in the editor's top corner and choose Import.
  3. Pick the birunx-all-pages.tpl file you downloaded, press Save, then close the editor.
  4. From Tags press New, then Tag Configuration, and choose BirunX — All Pages.
  5. Paste your store ID into Your Store ID (Required).
  6. Under Triggering choose the All Pages trigger.
  7. Name the tag and save it.

Add the Purchase tag

This tag runs once, on order confirmation, and sends us the order number together with the click ID captured earlier. That pairing is its whole job. The order's money — the revenue, the VAT, the shipping — reaches BirunX from your store platform directly, and never from the browser.

  1. Import the second template the same way: under Tag Templates press New, open the three-dot menu, choose Import, pick the birunx-purchase.tpl file, and press Save.
  2. Create a new tag and choose BirunX — Purchase under Tag Configuration.
  3. Paste the same store ID into Your Store ID (Required).
  4. Under DataLayer Schema pick the schema your platform uses. The next section explains the options.
  5. Under Triggering choose your store's purchase trigger: usually a custom event named purchase, or a view of the order-confirmation page.
  6. Name the tag and save it.
Do not attach the Purchase tag to the All Pages trigger. It would send a duplicate order for every page the buyer opens after checkout, and we would count the order more than once.
Leave Consent Mode on the recommended setting in both tags, and keep the two the same. If your store has no consent banner there is no signal to read, so the tags send as normal and you lose nothing. Choose Custom only if your banner reports consent through GTM variables rather than through Google Consent Mode.

Choosing the dataLayer schema

The schema is how your platform writes order data into the dataLayer. Pick the one that matches your platform; if you are not sure, start with the default and check the result in preview mode.

Option under DataLayer SchemaWhen to use it
Auto (Default) — Detect Schema AutomaticallyThe default. Tries the known schemas in order. Start here.
Salla — Use the Order ID override below (map 0.order_id via GTM DLV)Salla stores. The order ID is filled in by hand; see the note below the table.
ecommerce.transaction_id — GA4 Enhanced EcommerceGA4 ecommerce.
eventModel.transaction_id — GA4 Custom EventGA4 through a custom event. EasyOrders writes its orders here, and Auto finds them on its own — an EasyOrders store needs no change.
ecommerce.purchase.actionField.id — GA UniversalThe older Universal Analytics schema.
transactionId — Generic Top-LevelPlatforms that write the fields at the top level of the dataLayer.
Custom — Map the Order ID manuallyYou point the tag at the order ID yourself.
Salla stores: Salla writes order data under a numeric key, 0.order_id, and that is not a name GTM accepts in a dataLayer read permission. So when the Salla option is selected the template does not read the dataLayer at all, and you fill the Order ID field under Order ID (Override) with a GTM Data Layer Variable pointing at 0.order_id instead. This is standard GTM practice.

Publish and check

  1. Press Preview in GTM and open your store in the preview window.
  2. Browse any page and confirm BirunX — All Pages appears under Tags Fired.
  3. Complete a test order through to the confirmation page, and confirm BirunX — Purchase fired exactly once.
  4. Come back to BirunX: the Google Tag Manager page in the dashboard shows the first event we received and when it arrived.
  5. If everything looks right, press Submit and then Publish in GTM.
Neither tag runs on your live store until you publish. Preview is a private test of your own session.

If nothing arrives

  • Check you pressed Publish and not only Preview.
  • Check you copied the right store's ID. GTM refuses to save a tag whose ID is not exactly sixteen characters, so a truncated paste is caught immediately — but it cannot tell one store from another, so if you run more than one store, make sure the ID came from the right one.
  • Check the GTM container is installed on the order-confirmation page too, not only on the shop pages.
  • Open Preview and see whether the tag is listed under Tags Not Fired. If it is, the problem is the trigger, not the tag.
  • An ad blocker in your browser can block the tag while you are testing. Try a private window or a different browser.

If it still doesn't work, email us at support@birunx.com with your store name and store ID and we'll take it from there.

Installing BirunX with Google Tag Manager · BirunX