This project is using both Google Tag Manager API and Google Analytics API.
Create javascript snippet code for your Google Tag Manager by providing your Site Name, Site URL. This service will connect to your Google Analytics account to create a new web property for your account based on Site Name and Site URL command line params. After creating web property, it will get web property's tracking code to feed it into Google Tag Manager.
This project creates Universal Analytics Tag
Write operations in the Management API (e.g. create, update, delete, patch) for Web Property,
View (Profile), and Goal resources are currently available as a developer preview in limited beta.
If you're interested in using these features, request access to the beta.
Please create a project on Google Developer Console and apply to request access to beta before creating a web property to get tracking code.
#enable/disable sending javascript code snippet in email.
SEND_CODE_SNIPPET_EMAIL = True
# SMPT settings goes here...
# secret key must be in /secrets/ folder. otherwise change directory here
# How to get secret key JSON file. Follow link
# https://developers.google.com/tag-manager/api/v1/devguide#environment
GOOGLE_DEVELOPER_SECRET_KEY = os.path.join('secrets', 'google_developer_secret.json')
TIME_ZONE_COUNTRY_ID = 'US'
TIME_ZONE_ID = 'America/Los_Angeles'
# possible values: web, android, ios
GOOGLE_TAG_USAGE_CONTEXT = ['web']
pip install -r requirements.txt
# simply run from the command line
python index.py --site_name MY_SITE_NAME --site_url MY_SITE_URL
Python 2.7
Python 3.4
Google Tag Manager API Version 1
Google Analytics API Version 3
Ubuntu 14.04