my.neurhost.com · GTM-K55GQJWC · 3 Nov 2026

Purchase tracking, ready to approve.

The order page already pushes a purchase event. This adds the GA4 tag that listens for it, only after cookie consent. Nothing is published. The steps below are for the owner: one real order, a check in GA4, then publish.

17 / 17tests pass: hook in PHP 8.3, order page, tag rules
6 / 6broken hook copies caught by the tests
Draft onlytag is an import file; GTM, GA4 and the real order wait for the owner

Steps for the owner

In this order. Every step can be undone except the order itself: it stays in WHMCS and its invoice is real. Ticks are saved in this browser only.

0

One GA4 setting first

The checkout pages have e-mail and phone fields

2 min
1

Import the tag as a draft

File whmcs/gtm/ga4-purchase-etiketi.json

5 min
2

One real order, with GTM preview

Product: Giriş, monthly, no coupon

15 min

Any line wrong: stop, do not publish, send the Tag Assistant screenshot.

3

Consent declined check

No order needed

5 min
4

Approve and publish

Only if steps 2 and 3 passed

2 min

Undo: GTM › Versions › previous version › Publish.

The tag

Two locks: GTM is not loaded at all without “Kabul et”, and the tag itself requires analytics_storage.

Name
GA4 - purchase (siparis tamamlandi)
Type
Google Analytics: GA4 Event
Measurement ID
G-LTQ0P7NWHC
Event name
purchase
Ecommerce
Send Ecommerce data · source Data Layer
Event parameter
odendi = {{DLV - odendi}}
Consent
Require additional consent: analytics_storage
Trigger
Custom Event purchase (equals)
Firing
Once per event
// pushed by the hook, after consent, once per tab
{ "ecommerce": null }
{
  "event": "purchase",
  "odendi": 0,
  "ecommerce": {
    "transaction_id": "<order number>",
    "value": <order total>,
    "currency": "TRY",
    "items": [{ "item_id", "item_name",
                 "price", "quantity": 1 }]
  }
}
// no name, e-mail, phone, address or domain

What was tested

The real hook ran in PHP 8.3 (WebAssembly). The order page ran in jsdom with the real consent script; requests to Google were recorded, never sent. The GTM side is an imitation that reads the import file, not GTM itself.

Hook output

transaction_id is the visible order number (string), value is a number, currency TRY / EUR / TRY fallback, no personal data, empty on errors.

Consent accepted

One gtm.js request. Order: consent default › gtm.js › ecommerce reset › purchase. Tag fires once.

Refresh

Three reloads in the same tab: purchase pushed 0 times. A different order is still counted.

Consent declined

0 requests to Google, no purchase, nothing stored. Order number, heading and links work.

Accept on the order page

Panel open, no requests. “Kabul et” pushes the purchase once at that moment.

Mutation check

No refresh guard, no consent wait, fixed USD, internal id, value as text, no reset: each one fails a test.

Not verified

Open points. None of them blocks the owner steps.

  • Nothing ran in real GTM or GA4. The import file follows GTM’s export format but was not imported.
  • VAT in value: expected to be the WHMCS order total including KDV; item price is without KDV. Step 2 shows which one it is.
  • New tab: the guard is per tab. Reopening the order page in a new tab while the WHMCS session holds it would push again.
  • Items list hosting products only; a domain or add-on would be in value but not in items.
  • Card payments are closed; when they open the flow may skip this page. Retest then.
  • Windows repo: the hook copy is on this branch. It must be moved to hosting-platform/whmcs/tema-yamalari/ before any theme deploy.

Files on branch hub/10a42726

  • whmcs/tema-yamalari/neurhost-satin-alma-olayi.phplive hook, byte-for-byte, unchanged
  • whmcs/tema-yamalari/nx-cerez.tpl, cerez-onay.jsconsent panel and script the hook depends on
  • whmcs/gtm/ga4-purchase-etiketi.jsonGTM import: 1 tag, 1 trigger, 1 variable
  • whmcs/test/npm install --ignore-scripts && npm test
  • docs/_calisma-ga4-satin-alma-2026-11-03.mdfull report with manual click steps