SCALIX help

← All tools

gads_get_remarketing_tag

Google Ads read low risk

Part of the Google Ads Audience Agent.

What it does

Fetch the remarketing tag/pixel snippets for a remarketing action (GAQL on remarketing_action.tag_snippets). Returns the global site tag and event snippet(s) the client must install to populate remarketing lists, with their type and page_format. Read-only; no metrics. Use after creating a remarketing action to hand the install code to the user. Returns {success, data:[{remarketing_action:{id, name, tag_snippets:[{type, page_format, global_site_tag, event_snippet}]}}], count, warnings}. An unknown id is not_found, naming the gads_run_gaql_query read that lists the account's remarketing actions.

When to use it

When the user needs the remarketing/site tag snippet or asks whether remarketing tagging is set up on the account.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID; strip dashes.
remarketing_action_idstringyesNumeric remarketing action ID to fetch snippets for.
manager_idstringnoOptional MCC login-customer-id.

Safeguards

Policy

The remarketing tag enables behavioral tracking — the client must have a compliant privacy policy and (in EEA/UK) a consent mechanism before installing it. Do not embed the tag on sensitive-category pages.

Reminder

The tag must be installed only on pages covered by the client's disclosed privacy/consent policy; do not log or expose any visitor data.

Errors

Error classMeansWhat to doRetry
NOT_FOUNDNo remarketing action with that ID exists.List the account's remarketing actions with gads_run_gaql_query (SELECT remarketing_action.id, remarketing_action.name FROM remarketing_action) and confirm the ID.no
TOKEN_REVOKEDOAuth token expired/revoked.Refresh and retry once; else prompt reconnect (needs_reauth).yes
CUSTOMER_NOT_FOUNDCustomer ID not found/accessible.Verify the CID is authorized.no
PERMISSION_DENIEDNo access or out-of-bearer-scope read.Confirm read access; else refuse.no
MANAGER_ACCOUNT_NOT_QUERYABLEQueried an MCC; remarketing actions live on client accounts.Query the specific client account CID, not the manager.no
RESOURCE_EXHAUSTEDRate/quota exceeded (HTTP 429).Backoff 5/10/20s cap 60s, then retry.yes
INTERNAL_ERRORTransient Google server error (5xx).Retry after backoff.yes

Edge cases

  • Action exists but has no snippets yet -> return success with empty tag_snippets and a note.
  • Action ID not found -> NOT_FOUND (success:false), not an empty success.
  • Expired token -> refresh once and retry.
  • page_format distinguishes HTML vs AMP snippets (TrackingCodePageFormat); event_snippet present only for event-based actions, while the global site tag applies regardless of page_format.