Skip to content
Tragly

Tragly · WordPress plugin

Tragly for WordPress

Connect your site to Tragly with one browser sign-in. The plugin writes your container into the page, pushes WooCommerce events into the dataLayer and respects your consent platform.

v0.10.0 · 256 kB · WordPress 6.4+ · PHP 8.1+ · GPL-2.0-or-later
SHA-256: 3ee8765a0c8a3afaa74fd9176cc8239a9ce020e0cc16c3692e3152ff00df9b36

Honest status: everything listed here has been run on live sites except one thing - live purchase and refund delivery on a real shop has not been measured end to end yet. Until it is, test your checkout before you rely on revenue numbers. The plugin is released as a manual download; there is no WordPress.org listing.

What the plugin does

  1. Connects your site to your Tragly account - browser sign-in, no key to copy.
  2. Writes your Tragly container into wp_head and wp_body_open, loading from a hostname on your own domain.
  3. Pushes WooCommerce events into the dataLayer in the GA4 shape: view_item_list, view_item, select_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info, purchase.
  4. Lead and contact events: generate_lead (WPForms, Gravity Forms, Ninja Forms, Contact Form 7, Elementor Pro Forms), phone_click, email_click. No field values, phone numbers or e-mail addresses are ever pushed.
  5. Campaign attribution (UTM and click IDs in a first-party cookie, only after consent) and GA4 / Search Console / PageSpeed reports in wp-admin.

It deliberately does not call any Google API itself, send your key to the browser, put personal data in the dataLayer, override your consent platform, or fake a connection.

Before you start

  • A Tragly account (request a pilot if you do not have one yet).
  • WordPress 6.4+ and PHP 8.1+. WooCommerce is optional.
  • Your theme should call wp_body_open() - otherwise the noscript part of the container has no place to go (the plugin tells you on its own screens).
  • If the site already runs Google Tag Manager or a Site Kit Google tag, decide which one stays. Two containers on one page is a race for consent state, not a setting.

Install from the ZIP

  1. Download the ZIP with the button above. Check the SHA-256 next to it if you want to verify the file.
  2. In wp-admin go to Plugins → Add New → Upload Plugin, choose the ZIP, press Install Now, then Activate. (The ZIP contains one top-level tragly/ folder - the folder name WordPress installs it under.)
  3. Open Tragly → Connection and press Connect to Tragly.
  4. You are sent to tragly.com: sign in and approve this site. The key comes back on its own - you never copy or paste it, and it never appears in the address bar.
  5. The plugin registers the site's domain with Tragly and mirrors the container details back.
  6. Open Tragly → Dashboard. When the Measurement card says the container is active, the snippet is on your pages.

If the site is not reachable from the internet (a local test site) or you already hold a key, paste the key by hand on the same Connection screen. It needs the scopes read, sites.write and ingest; without ingest everything works except server-side delivery (refunds), and Tragly → Status says so.

Check that it works

  • Tragly → Status names the exact reason when something is missing: no key, key rejected, container still provisioning, or one specific container field Tragly has not sent. With no key or missing details the plugin writes nothing rather than a half-correct snippet.
  • Press Refresh from Tragly; the Installation proof section reads Verified once Tragly has signed this site's installation and the signed set is current.
  • Tools → Site Health reports "The Tragly installation is verified" only when both snippet blocks carry the proof and the last front-page check found them in place.
  • In the browser console on a product page type dataLayer: you should see a view_item entry with an ecommerce.items array.

Consent Mode v2

  • If a consent platform is active, the plugin leaves consent entirely to it and never writes a second default block over a visitor's stored choice. That is not configurable.
  • ConsentKit is recognised by its own signal (the CONSENTKIT_ACTIVE constant and the consentkit_loaded action), even if its folder was renamed.
  • With no consent platform active, the plugin writes a default-denied block (analytics_storage, ad_storage, ad_user_data, ad_personalization = denied, wait_for_update 500). With nothing able to grant consent, that means no measurement until you add a banner. You can switch the default off in Settings.
  • Whether you need a banner depends on your site and jurisdiction; the plugin does not decide that for you.

Thank-you pages (optional)

Settings → Thank-you pages: one path event_name per line, for example /thank-you/ generate_lead. Counted once per browser session per page; only the path and event name are pushed, never the query string. Keep these pages out of menus and sitemaps, and list a page only for forms that do not already report generate_lead themselves - otherwise the lead is counted twice.

Updating

  • Download the newer ZIP from this page and upload it the same way (Plugins → Add New → Upload Plugin; WordPress offers to replace the current version). Settings and the connection are kept.
  • From 0.8.11 on the plugin can also receive signed updates from tragly.com once a signed release record is published; until then use the manual upload. Refresh from Tragly on the Status screen also renews the installation proof.
  • From 0.9.0 the plugin checks for updates with its connection key. This key-based update check has not yet been measured on a live site; on any error the plugin falls back to the public package on this page, so the manual upload always works.

Disconnect and uninstall

  • Disconnect offers to revoke the key (ticked by default). Untick it only if the same key is deliberately used elsewhere.
  • Deleting the plugin always revokes the key, so nothing stays alive after the plugin is gone.

Troubleshooting

SymptomWhat to check
Nothing is measuredTragly → Status names the reason (no key / key rejected / container provisioning / a missing container field).
"Degraded" installationSite Health names the reason. Purge any page cache, press Refresh from Tragly on the Status screen and re-check.
Another GTM container on the pageThe plugin fetches your real front page and warns; it never removes your code. Keep one container.
Two consent defaults in the dataLayerA consent platform and a container tag are both writing one. Keep a single source (the plugin steps aside if it detects a consent platform).
Cannot connect (local or password-protected site)Paste a key by hand on the Connection screen; the browser sign-in needs the site reachable.
No purchase eventsWooCommerce must be active; purchase fires once per order on the thank-you page and is marked on the order, so a refresh does not duplicate it.

Privacy

The plugin stores the key in wp_options (autoload off), never prints it or sends it to JavaScript, and strips it from debug logs. Once connected it reports to Tragly the installation state (verified / degraded / legacy / disabled) and the plugin and snippet versions - nothing about visitors.

Help and support

Stuck? Read the Tragly help page, or contact us - include the text of the Tragly → Status screen and your WordPress and PHP versions, and we can usually answer in one message. Never send your key; the Status screen does not show it.