The Google Tag Manager API provides access to Google Tag Manager configuration data for an authorized user. With this API you can manage: accounts, containers, worksapces, tags, triggers and variables
The Google Tag Manager API handles millions of operations. To protect the system from receiving more operations than it can handle, and to ensure an equitable distribution of system resources, it is necessary to employ a quota system.
https://developers.google.com/tag-manager/api/v2/reference https://developers.google.com/tag-manager/api/v2/devguide
- 50,000 requests per project per day, which can be increased.
- 10 queries per second (QPS) per IP address
- By default, it is set to 100 requests per 100 seconds per user
- This can be adjusted to a maximum value of 1,000.
python -m venv venv
source ./venv/bin/activate (Mac) or venv\Scripts\activate (Windows)
pip install -r requirements.txt
https://console.cloud.google.com/
mkdir conf
mv xxxxx-xxxxx.json client_secrets.json
touch .env
- CLIENT_SECRETS='conf/client_secrets.json'
- ACCOUNT_ID='xxxx'
- CONTAINER_NAME='xxxx'
- CONTAINER_ID='xxxx'
- WORKSPACE_NAME='xxxx'
- WORKSPACE_ID='xx'
CLIENT_SECRETS = config('CLIENT_SECRETS')
ACCOUNT_ID = config('ACCOUNT_ID')
CONTAINER_NAME= config('CONTAINER_NAME')
CONTAINER_ID = config('CONTAINER_ID')
WORKSPACE_NAME = config('WORKSPACE_NAME')
WORKSPACE_ID = config('WORKSPACE_ID')
you can scan the account, container, workspace, tag, trigger, variable information by using gtm_scanner.py
python project/run_scanner.py
you can create new workspaces, tags, triggers, variables and publish these by using gtm_creator.py
python project/run_creator.py