How the code part works
AdLoop never reads your files, on AdLoop Cloud or self-hosted. Your AI client (Claude Code, Cursor, …) searches your codebase itself forgtag('event', …) and dataLayer.push({event: …}) calls, collects the event names, and passes that list to the tool. So the code comparison needs an AI client with access to the repository; in a chat without your code, your AI can still run the GA4, GTM and Ads checks.
The workflow
- Rule out consent first. In the EU, Ads usually shows several times more clicks than GA4 shows sessions because many visitors decline analytics cookies. That’s normal, not broken tracking; see consent and data gaps.
-
Is anything missing?
attribution_checkcompares the conversions Google Ads reports with what GA4 records, optionally for named events such assign_uporpurchase, and says whether a gap is explained by consent. -
Code against GA4.
validate_trackingtakes the event names from your code and returns which ones GA4 receives, which are missing, which arrive without a code reference, and which GA4 collects automatically. It looks at the last 28 days by default. -
Code against GTM against GA4.
audit_event_coverageadds the live Tag Manager container and gives every event a status:Your AI drills into flagged tags and triggers with the Tag Manager tools. -
Fix it.
generate_tracking_codewrites a ready-to-paste gtag snippet, with Google’s recommended parameters for standard events and an optional form-submit, button-click or page-load listener, and checks whether the event already arrives in GA4. If an event arrives but isn’t a key event,draft_key_eventmarks it as one, through the usual preview and confirmation.
Paid traffic against GA4
For “what do my ads really achieve?”:analyze_campaign_conversions: Ads clicks and cost per campaign against GA4 sessions and conversions, the real cost per conversion, and the click-to-session ratio as a consent indicatorlanding_page_analysis: paid sessions, conversion rate and engagement per ad landing page, including pages that get clicks but never convert. A slow page is worth a PageSpeed check.
Tools
attribution_check,analyze_campaign_conversions,landing_page_analysis: Google Ads ↔ GA4 cross-checksvalidate_tracking: your code’s events ↔ GA4generate_tracking_code: gtag snippetsaudit_event_coverage: your code’s events ↔ live GTM container ↔ GA4
tracking toolset, except audit_event_coverage, which belongs to gtm (toolsets). Parameters are in the tool reference.
Limits
- Tag Manager tags with a dynamic event name (
{{Event}}) and Custom HTML tags can’t be interpreted automatically; the audit lists them for a manual look. - The audit compares the published container. Unpublished edits show up in
get_gtm_workspace_diff. - On AdLoop Cloud,
analyze_campaign_conversions,landing_page_analysisandattribution_checkquery Google Ads and count as Google Ads operations. The other tracking tools are unmetered. See plans and limits.