Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Own-account API: every call acts as the Google user the refresh token belongs to, and only reaches accounts that user can access.
- Resources nest: account > container > workspace > tags, triggers, variables. Ids are digits; the public GTM-XXXX id is not an API id.
- Lists page with pageToken/nextPageToken. A publish makes a container version live on the real site; create_version only snapshots a workspace.
- Per-method OAuth scopes are narrower than one broad token: reads need tagmanager.readonly, creating a version needs tagmanager.edit.containerversions, publishing needs tagmanager.publish.