Canonry treats Google Ads and Google Tag Manager (GTM) as separate, project-scoped integrations joined by one conversion-tracking contract. Canonry’s first-release code path is read-only: it can authorize, discover, select, snapshot, compare, and audit. It does not mutate Google Ads or create, update, version, or publish GTM resources.
This guide applies to cnry serve. This host supplies the private credential
store, OAuth adapter, provider readers, sync workers, and integrity evaluator.
The standalone apps/api entry point is unsupported for this integration in
version 1. It does not supply the OAuth, credential-store, provider-reader,
sync, or integrity adapters that complete the workflow.
You need these items:
cnry serve instance and an existing Canonry project.Use these Google guides:
https://www.googleapis.com/auth/adwordshttps://www.googleapis.com/auth/tagmanager.readonlyThe default local redirect URI is:
http://localhost:4100/api/v1/google-marketing/callback
For the default OAuth flow, open the dashboard at http://localhost:4100.
The dashboard origin and callback origin must match for the browser-binding
cookie.
A remote installation uses this pattern:
<public-url>/api/v1/google-marketing/callback
Set a stable publicUrl in config.yaml for a remote installation. Include
the mount path once in that URL. For example:
publicUrl: https://canonry.example.com/canonry
Register https://canonry.example.com/canonry/api/v1/google-marketing/callback
for that example. The dashboard displays the callback automatically only for
the default local host.
If you also use Search Console or Business Profile, add the separate redirect URI that Canonry displays for those integrations.
GOOGLE_ADS_DEVELOPER_TOKEN on the local server.The developer token is private installation-wide configuration. OAuth connections and selected resources are project-scoped.
Canonry stores a selected draft graph for review. The integrity assessment uses the live container graph. It does not assess unpublished draft changes.
The Google Ads sync stores conversion actions, effective campaign goals, and bounded metrics. The Tag Manager sync stores sanitized live and selected-draft graphs.
Use Project → Conversions → Declare conversion for the normal setup flow. Enter the website event, Google Ads action ID, and Tag Manager tag ID.
Additional rules can require these items:
Use canonical IDs from the current snapshots. Use the Ads customer ID without
dashes, the conversion-action id, and each GTM resource id. Do not use a
GTM resource path or the public GTM-... container ID.
The CLI accepts the same contract as JSON. This purchase example enables all runtime field requirements:
{
"name": "Purchase completed",
"eventName": "purchase",
"googleAds": {
"customerId": "1234567890",
"conversionActionId": "987654321",
"conversionId": "AW-1234567890",
"conversionLabel": "purchase_label",
"campaignIds": [],
"requireBiddableGoal": true,
"requirePrimaryAction": true
},
"gtm": {
"accountId": "123456",
"containerId": "654321",
"tagId": "42",
"triggerIds": ["17"],
"variableIds": ["21", "22", "23"]
},
"runtime": {
"verificationRequired": true,
"requireTransactionId": true,
"requireValue": true,
"requireCurrency": true,
"productionHosts": ["example.com"]
}
}
Save the file as contract.json. Then create and assess the contract:
cnry conversion-tracking contracts create my-site --input contract.json
cnry conversion-tracking contracts my-site --format jsonl
cnry conversion-tracking contracts integrity my-site <contract-id> --format jsonl
Empty campaignIds, triggerIds, and variableIds arrays disable their
corresponding assertions. Canonry checks requireBiddableGoal only for listed
campaigns. If you do not know the exact GTM-facing values, omit conversionId
and conversionLabel. Do not supply server-owned IDs or timestamps.
website event
|
v
GTM live tag -> trigger + variables ----+
|
v
declared conversion contract -> static integrity assessment
^
|
Google Ads conversion action -> effective campaign goals -> bounded metrics
static integrity assessment + trusted runtime observation -> observed status
(reserved: no v1 recorder)
An Ads conversion action being primary is not the same as an effective campaign goal being biddable. Canonry therefore retains customer goals, campaign goals, custom goals, and campaign goal configuration as distinct evidence before deriving an effective per-campaign goal graph.
A GTM API snapshot proves configuration only. It does not prove that a browser event occurred, that a tag fired, or that Google Ads recorded a conversion. An assessment reports one of these evidence states:
configured — a contract exists, but its static graph is missing or inconsistent.statically-consistent — the stored Ads and GTM graphs agree with the contract.runtime-unverified — static configuration is consistent, but required runtime evidence is absent.observed — both static and trusted runtime evidence are present.Opaque custom HTML and custom templates are always unknown / needs-review.
They are never inferred as passing.
The contract model reserves observed for trusted runtime evidence. The
default Canonry runtime does not store that evidence in version 1.
A runtime-required contract therefore stops at runtime-unverified, even
after an operator completes the manual runtime procedure.
Run the offline Doctor checks:
cnry doctor --project my-site --check 'google-ads.*' --format json
cnry doctor --project my-site --check 'gtm.*' --format json
Doctor reports credential metadata, OAuth scopes, selected resources, snapshot age, and repeated sync failures from stored run rows (the latest run error and the last successful sync). Doctor does not call Google or prove browser tag firing. While a credential, scope, or selection check fails, the sync-failure check is reported as superseded, so the health alert names that fix rather than the syncs it breaks.
Then review each integrity assessment. Inspect every fail or unknown
finding and its evidence IDs.
Use recognizable test values and a production-host guard. Preview traffic can send a real Google Ads conversion.
This procedure does not change the Canonry status in version 1. Keep the runtime result in the operator’s external evidence record.
The operator must complete OAuth, resource selection, and contract creation. An agent must not request OAuth credentials or a developer token.
For MCP, call canonry_load_toolkit with each input below. Wait for each call
to return before you call a newly enabled tool.
{ "name": "google-ads" }{ "name": "gtm" }{ "name": "conversion-tracking" }{ "name": "monitoring" }Use these Google Ads tools:
canonry_google_ads_statuscanonry_google_ads_customerscanonry_google_ads_snapshotscanonry_google_ads_snapshot_getcanonry_google_ads_syncUse these GTM tools:
canonry_gtm_statuscanonry_gtm_accountscanonry_gtm_containerscanonry_gtm_workspacescanonry_gtm_snapshotscanonry_gtm_snapshot_getcanonry_gtm_syncUse these contract tools:
canonry_conversion_tracking_contractscanonry_conversion_tracking_contract_getcanonry_conversion_tracking_integrityUse stored snapshots first. Stored reads are local, redacted, and quota-free.
Before a live provider discovery or sync, get explicit approval. Live discovery
needs a full-instance key with google-marketing.read-live.
A sync needs google-marketing.read-live and google-marketing.write. It can
use a project-scoped key. It queues a run and writes only Canonry runs and
sanitized snapshots.
Read the returned run ID. Call canonry_run_get with
{ "runId": "<run-id>" } until the run reaches completed, failed, or
cancelled. Assess new evidence only after completed. If the run fails or is
cancelled, report that result instead.
Use canonry_conversion_tracking_integrity to assess one contract. Do not
treat runtime-unverified as a static failure.
After the monitoring toolkit loads, call canonry_organic_evidence. This
result combines AEO visibility, GSC, GA4, and server evidence.
Use conversion integrity as a measurement-confidence gate:
Canonry does not join one organic question or citation to one Google Ads conversion. Keep organic evidence and paid attribution separate.
Stored snapshots are the default. They are local, redacted evidence and do not
call a Google provider. The explicit capability for a bounded, quota-consuming
provider refresh is google-marketing.read-live. This is a Canonry capability,
not a restriction on the Google-issued OAuth token. Google Ads exposes the broad
adwords OAuth scope, so connect a Google Ads user with the Read-only account
role and use a developer token approved for Reporting permissible use. GTM uses
its read-only OAuth scope.
The public namespaces are google-ads and gtm; ads remains reserved for
OpenAI/ChatGPT Ads. API, generated SDK, CLI, MCP toolkits, doctor checks, and the
project UI must preserve that separation. Agents may inspect stored evidence.
They need google-marketing.read-live for a live read. OAuth, resource selection,
disconnect, and any future provider mutation remain explicit operator actions.
OAuth starts and completes in the same signed-in browser, with an explicit
confirmation before credentials are persisted. CLI and MCP do not print or
transfer OAuth URLs.
Register the exact shared callback on the Google OAuth web client:
<canonry-public-url>/api/v1/google-marketing/callback (for a default local
install: http://localhost:4100/api/v1/google-marketing/callback). A pending
flow is process-local and expires after 15 minutes; restart it after a server
restart, browser change, or expiry.
redirect_uri_mismatchOpen Settings → Google OAuth. Copy the exact Google Ads and Tag Manager redirect URI into the Web application OAuth client.
Make sure that the OAuth user has access to the target customer. If you use a manager account, select the correct manager and customer pair.
Make sure that the developer token can access the target account type. A test-only token cannot read a production account.
Make sure that the OAuth user has access to the required account and container. After you change its Google permissions, reconnect Tag Manager.
An external OAuth application in Google testing mode can issue a refresh token that expires after seven days. Use production status for scheduled operation.
runtime-unverifiedThis status is expected when the contract requires runtime proof. Version 1 does not store the result of the manual runtime procedure.
The assessment uses the live container graph. Inspect the stored draft snapshot separately, then publish through the normal Tag Manager approval process.
apps/api instance reports unavailable routesUse cnry serve for this integration. The standalone Cloud API entry point is
unsupported because it lacks the required host adapters in version 1.
Version 1 has no Google Ads mutation path. It has no GTM workspace edit, version, or publish path. A live read never changes that boundary.
Write support must be proposal-bound. Google Ads mutations require a reviewable plan and explicit approval. GTM workspace edits and GTM publish are separate approval events; approval to edit a draft never implies approval to publish it.
canonry doctor --project <project> includes API host checks that send no credentials for Google Ads and GTM. The check completes a TLS handshake without sending an HTTP request or credentials. A DNS block fails with the provider host and the sync command to retry; private, connect, and TLS results warn, while a local resolver outage is skipped. Use the check details to correct host filtering or outbound access before re-running the affected sync.