How Tag Companion Works

Deep dive into the technical details: SDK architecture, GTM container file generation, and why it just works.

Important: Tag Companion generates GTM container files. You import them into Google Tag Manager and publish your container. We don't replace GTM; we automate the configuration work.

The Core Workflow

Tag Companion has three main tools, each with a slightly different workflow optimized for its specific tracking needs:

1. Behaviours Events No SDK needed

Tracks scroll depth and time on page. No SDK needed: just configure thresholds and download your container file.

  • Configure event name and tracking thresholds
  • Set page targeting (all pages or specific URLs)
  • Download GTM container file with pre-configured triggers

2. Actions Events SDK auto-sends selector

Tracks clicks, visibility, and AJAX responses. The SDK automatically passes the selector back to the dashboard.

  1. Launch Website Helper from dashboard
  2. Click the element you want to track
  3. Click "Submit to GTM Builder"
  4. Selector automatically populates in dashboard
  5. Configure event details and download container file

3. eCommerce Events SDK + manual paste

Tracks GA4 eCommerce events. Multiple selectors per event (item_name, price, etc.), so you copy/paste each one.

  1. Launch Website Helper
  2. Click an element (e.g., product name)
  3. Selector copies to clipboard automatically
  4. Paste into corresponding parameter field in dashboard
  5. Repeat for each parameter (price, SKU, etc.)
  6. Download complete eCommerce tracking container file

The Website Helper (SDK)

What makes our point-and-click selector tool special

Smart Selector Algorithm

First tries unique attributes (data-id, aria-label, id) before falling back to complex CSS selectors. Adapts to minor page changes automatically.

Visual Feedback System

Color-coded highlights show exactly what you're selecting: hover (blue), selection (red), multiple matches (orange), confirmed (green).

Multi-Element Detection

When your selector matches multiple elements, we alert you and let you click "Next" to cycle through them until you find the exact one you want.

Automatic nth-child Calculation

No more counting elements manually. The SDK calculates nth-child positions automatically for precise targeting.

Session-Based Security

Uses 24-hour tokens with hourly re-validation. The SDK only activates when YOU launch it from your dashboard. Never appears to regular visitors.

Zero Dependencies

Pure JavaScript. No jQuery required. Works with any standard website. Minimal page load impact.

SDK vs DevTools: How selectors actually behave

What the code does in each scenario, and where the advantage is real vs. equal.

Scenario Tag Companion SDK DevTools
Unique element with its own meaningful class Outputs the shortest class-based path that matches only that element (e.g. p.hero-subtitle). Won't break unless that specific class is renamed. Changes anywhere else on the page don't matter. Outputs the full path anchored to the nearest ID or body. Breaks if any ancestor div is added, removed, or reordered — even if the element itself didn't change.
Unique element with a stable attribute (data-testid, aria-label, name, etc.) Checks for stable attributes on the element and its ancestors first. If found, outputs e.g. button[data-testid="add-to-cart"] — survives any structural or class change as long as the attribute stays. Never checks for stable attributes. Goes straight to a structural path.
Unique element anchored to an ID ancestor Automatically roots the path at the nearest ID — e.g. #hero > p.subtitle. Shorter path, fewer breakable ancestors. Also anchors to the nearest ID, but includes all ancestors above it too — more nodes, more points of failure.
Unique element — no useful class, no stable attribute Falls back to a structural path, same as DevTools. Both are equally fragile here. Same structural path. No advantage either way.
Multiple identical elements — parent has a unique class Uses :nth-child anchored at the nearest ID or unique class — e.g. #features > div.card:nth-child(2). Won't break if code outside that anchor changes. Uses :nth-child anchored to nearest ID or body. Breaks if anything in the full ancestor chain changes.
Multiple identical elements — one has a stable attribute On refinement, checks for stable attributes first — outputs e.g. button[aria-label="Buy now"] instead of :nth-child. Survives reordering as long as the attribute stays. Always positional. Reorder the elements and it fires on the wrong one.
Multiple identical elements — no useful class or attribute Same positional output as DevTools. Both break on reorder or insertion. Same. No advantage either way.
Bootstrap or utility-class heavy page (col-md-6, mb-0, d-flex) Picks up utility classes, but a developer restyling the component breaks the selector. Both tools are equally weak here. Same weakness, different path.

Installation: 30 Seconds in GTM

The Website Helper doesn't require any website code changes. It installs entirely through Google Tag Manager:

  1. Download the SDK container file from your Tag Companion dashboard
  2. Import into Google Tag Manager (Admin → Import Container)
  3. Publish your GTM container
  4. Launch the Website Helper from Tag Companion: it's ready to use
No developer needed: The SDK loads through Tag Manager only when you activate it from your dashboard. Your website's source code never changes. Regular visitors never see it.

Ready to Point, Click, and Track?

No CSS selectors. No JavaScript. No developer needed.

Free plan available • No credit card required

Built-In AJAX Handling

Traditional GTM setup fails when forms submit without page reloads. You need custom JavaScript to intercept the request. Most marketers don't know how.

Our Solution

Tag Companion automatically generates a universal AJAX listener that intercepts:

  • XMLHttpRequest: Traditional AJAX calls
  • Fetch API: Modern async requests
  • jQuery.ajax: If jQuery is present
How it works:
When you select "AJAX Response Tracking," we generate a Custom HTML tag that listens for all AJAX activity. You specify which response parameter to track (like response.success), and we create a trigger that fires when that value matches your condition.

No custom JavaScript required

No debugging in browser console

Works with any AJAX library

GTM Container File Generation

What we generate for you automatically

GA4 Event Tags

Pre-configured with your event name, GA4 Measurement ID (or variable), and any event parameters you specified.

Custom Triggers

Click triggers with CSS selectors, visibility triggers with intersection observers, scroll depth triggers, timer triggers, AJAX custom events, all properly configured.

Variables

Data layer variables for AJAX responses, custom JavaScript variables for complex extractions, constant variables for configuration values.

Built-in Variables (Auto-Enabled)

Automatically enables required GTM built-in variables (Click Element, Page Path, Scroll Depth Threshold, etc.) so everything works out of the box.

Why this matters: Manually enabling GTM built-in variables is tedious and error-prone. Miss one variable and your tracking silently fails. We handle this automatically; your container files work first try.

AJAX Listeners (when needed)

Complete Custom HTML tag with universal AJAX interceptor code that pushes structured data to the data layer.

Skip the Manual GTM Configuration

We generate tags, triggers, and variables automatically. Import to GTM and you're done.

Works first try • 30-day money-back guarantee

eCommerce Tracking (Pro Plan)

The most advanced feature: complete GA4 eCommerce tracking without writing code

1,737 Lines of GA4 Parameter Definitions

We've built the entire GA4 eCommerce schema into the tool:

  • All 13 GA4 eCommerce events (view_item, add_to_cart, purchase, etc.)
  • Event-level parameters (currency, value, transaction_id, tax, shipping)
  • Item-level parameters (item_name, item_id, price, quantity, item_brand, etc.)
  • Real-time validation with helpful error messages
  • Reporting status indicators (which parameters GA4 actually uses)

Two Modes: Grow With Your Skill Level

Beginner Mode:

  • Only the most important parameters
  • Simplified interface; can't mess up
  • Focus on well-reported GA4 fields
  • Perfect for getting started fast

Advanced Mode:

  • All GA4 parameters available
  • Custom parameter support
  • Full control for complex setups
  • When you need every detail

The difference: Other tools either overwhelm you with options or limit what you can do. We give you both.

Multi-Event Configuration

Set up multiple eCommerce events in one session:

  • Configure view_item, add_to_cart, and purchase in sequence
  • Reuse selectors across events (select product name once, apply to all events)
  • Download one complete GTM container with all events configured

Save Progress to Your Computer

eCommerce tracking is complex; each event requires multiple parameters with different CSS selectors. Don't lose your work to session timeouts or browser crashes:

  • Save anytime: Download your configuration as a JSON file to your computer
  • Resume later: Upload your saved file to pick up exactly where you left off
  • Work at your pace: No rush to finish in one sitting. Take breaks. Come back tomorrow.
  • Zero risk: Session interruptions won't cost you hours of work
Real scenario: You're configuring 8 eCommerce events with 12 parameters each. That's 96 CSS selectors to map. Save your progress after every event. If something goes wrong, you've only lost 10 minutes, not 2 hours.

eCommerce Tracking Without the Headache

All 13 GA4 eCommerce events. Beginner and Advanced modes. Save your progress.

Pro plan includes complete eCommerce tracking • 30-day guarantee

Compatibility

What Tag Companion works with (and what it doesn't)

Works Great With

  • Standard landing pages
  • Marketing websites
  • Multi-page websites
  • WordPress, Shopify, WooCommerce
  • eCommerce product/cart pages
  • Sites with AJAX forms (we handle automatically)
  • Landing page builders (Unbounce, Leadpages, Instapage)

Not Recommended For

  • Sites where navigation happens without a full browser page reload
  • Apps with dynamic class names that change on each build (CSS modules)
Quick test: Click a navigation link on the site. If the browser reloads the page, Tag Companion works. If the content swaps instantly with no browser reload, CSS selectors may be unreliable due to client-side routing or dynamic DOM rendering.

Ready to Stop Fighting with GTM?

Start tracking in minutes. No credit card required for free plan.