Home > database >  How do I extract data from Data Layer via Google Tag Manager/Analytics API
How do I extract data from Data Layer via Google Tag Manager/Analytics API

Time:03-25

Data Layer Has been deployed to my website. However, I'm struggling to find a way to extract the data which is held in Google Tag Manager, for it to be used in PowerBI, etc

Preferably, I would like to use python to create this ETL pipeline. Can you give me a direction to look into?

The general Google Tag Manager seems to be used for configuring the data layers/variable/accounts etc. With no clear way to extract the data

CodePudding user response:

Google Tag Manager doesnot holds the data. It's a tag manager, which means it contains Javascript codes known as tags to send the data to Google Analytics. Datalayer is the JS object that exists on your web platform and contains metadata that you push from backend/frontend.

The data is actually collected in Google Analytics.

So, if you want to pull the data from Google Analytics, you have two options

  1. If you are a GA360 premium customer: you can use Big Query data dump to export that data from BQ to the internal Data warehouse. You can unflatten the structure of the data(GA3) and get the pipeline started. You can also use a direct BQ connector in Power BI

  2. If you use GA free( universal analytics) - Your only hope is to use GA API to pull the data in the warehouse.

If you use GA4 - then GA4 has Big Query connection for the free version as well, you can use BQ to pull the data or connect BQ as a connector in Power BI

CodePudding user response:

Great Question.

Please refer to the documentation on https://developers.google.com/tag-platform/tag-manager/web/datalayer

  • Related