{"id":19021620,"url":"https://github.com/buildwithlal/python-google-tag-manager-analytics","last_synced_at":"2025-04-23T07:54:57.147Z","repository":{"id":52314123,"uuid":"77073456","full_name":"BuildWithLal/python-google-tag-manager-analytics","owner":"BuildWithLal","description":"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","archived":false,"fork":false,"pushed_at":"2021-04-30T20:34:24.000Z","size":14,"stargazers_count":8,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T07:54:49.015Z","etag":null,"topics":["analytics","analytics-api","analytics-tracking","google-analytics","google-analytics-python-api","google-tag-manager","google-tag-manager-python-api","universal-analytics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BuildWithLal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-21T17:43:03.000Z","updated_at":"2024-09-27T09:31:22.000Z","dependencies_parsed_at":"2022-08-22T15:00:44.527Z","dependency_job_id":null,"html_url":"https://github.com/BuildWithLal/python-google-tag-manager-analytics","commit_stats":null,"previous_names":["lalzada/python-google-tag-manager-analytics","buildwithlal/python-google-tag-manager-analytics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fpython-google-tag-manager-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fpython-google-tag-manager-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fpython-google-tag-manager-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fpython-google-tag-manager-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BuildWithLal","download_url":"https://codeload.github.com/BuildWithLal/python-google-tag-manager-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250395200,"owners_count":21423376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-api","analytics-tracking","google-analytics","google-analytics-python-api","google-tag-manager","google-tag-manager-python-api","universal-analytics"],"created_at":"2024-11-08T20:22:49.833Z","updated_at":"2025-04-23T07:54:57.125Z","avatar_url":"https://github.com/BuildWithLal.png","language":"Python","readme":"##### Google Tag Manager Python API integrated with Analytics API\n\nThis project is using both [Google Tag Manager API](https://developers.google.com/tag-manager/api/v1/devguide) and [Google Analytics API](https://developers.google.com/analytics/devguides/config/mgmt/v3/quickstart/installed-py).\nCreate 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.\nThis project creates [Universal Analytics](https://support.google.com/analytics/answer/2790010?hl=en) Tag\n\u003cbr/\u003e\n\u003cbr/\u003e\n##### Warning from Google Analytics API docs\n```\nWrite operations in the Management API (e.g. create, update, delete, patch) for Web Property,\nView (Profile), and Goal resources are currently available as a developer preview in limited beta.\nIf you're interested in using these features, request access to the beta.\n```\nPlease create a project on [Google Developer Console](https://console.developers.google.com/flows/enableapi?apiid=analytics\u0026credential=client_key) and apply to [request access to beta](https://docs.google.com/forms/d/e/1FAIpQLSf01NWo9R-SOHLKDUH0U4gWHNDBIY-gEI-zqBMG1Hyh3_hHZw/viewform) before creating a web property to get tracking code.\n\n\u003cbr/\u003e\n\n##### Enable required APIs\n[Enable Google Tag Manager API](https://console.developers.google.com/start/api?id=tagmanager\u0026credential=client_key)\n\n[Enable Google Analytics API](https://console.developers.google.com/flows/enableapi?apiid=analytics\u0026credential=client_key)\n\n\u003cbr/\u003e\n\n##### Make required changes in settings.py\n\n```python\n #enable/disable sending javascript code snippet in email.\nSEND_CODE_SNIPPET_EMAIL = True\n\n# SMPT settings goes here...\n\n# secret key must be in /secrets/ folder. otherwise change directory here\n# How to get secret key JSON file. Follow link\n# https://developers.google.com/tag-manager/api/v1/devguide#environment\n\nGOOGLE_DEVELOPER_SECRET_KEY = os.path.join('secrets', 'google_developer_secret.json')\n\nTIME_ZONE_COUNTRY_ID = 'US'\nTIME_ZONE_ID = 'America/Los_Angeles'\n\n# possible values: web, android, ios\nGOOGLE_TAG_USAGE_CONTEXT = ['web']\n```\n\n\u003cbr/\u003e\n\n##### Switch to project root directory and Install dependencies from requirements.txt file\n\n```\npip install -r requirements.txt\n```\n\n\u003cbr/\u003e\n\n##### What command do i need to execute?\n\n```\n# simply run from the command line\npython index.py --site_name MY_SITE_NAME --site_url MY_SITE_URL\n```\n\n\u003cbr/\u003e\n\n##### What do you get?\n\n![Google Tag Manager Preview](http://i.imgur.com/uzeDj0b.png)\n\n\u003cbr/\u003e\n\n##### Tested Environment\n\n```\nPython 2.7\nPython 3.4\nGoogle Tag Manager API Version 1\nGoogle Analytics API Version 3\nUbuntu 14.04\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildwithlal%2Fpython-google-tag-manager-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildwithlal%2Fpython-google-tag-manager-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildwithlal%2Fpython-google-tag-manager-analytics/lists"}