Skip to content

thoughtspot/tmlblock-googleanalytics

Repository files navigation

Google Analytics TML Blocks

Create a set of ThoughtSpot visualizations based on Google Analytics data hosted in Snowflake. Analyze user acquisition and user behavior of your website with search, drill-downs, and spotIQ.

Artifacts

Python Script

Python Script (HelloAnalytics.py) to download data via the Google Analytics API.

Snowflake DDL

Snowflake DDL (snowflake_ga.sql) for creating tables and views that flatten the Google Analytics JSON data.

Worksheets

  • AdWords Analysis
  • Demographic Audience Analysis
  • Geographic Audience Analysis
  • Page Behaviour Analysis
  • Site Statistics Analysis
  • Traffic Source Analysis
  • Manifest_worksheet.yaml

Liveboards included

  • Manifest_liveboard.yaml

Acquisition

  • Adwords
  • Traffic Sources

Audience

  • Geographic Location

Behavior

  • Page Analytics
  • Site Statistics

Installation instructions

Local environment configuration

This starter kit uses the Google analytics reporting API v4. Hello Analytics Reporting API V4. To get started, execute the following commands on your local environment.

setup virtual environment

sudo -s apt-get install python3-venv python3 -m venv analytics-quickstart

Activate virtual environment:

source analytics-quickstart/bin/activate

install google api packages

pip install --upgrade google-api-python-client pip install --upgrade oauth2client

Retrieve and prep your data

  • Use the HelloAnalytics.py Python Script to download your Google Analytics data to either your local machine or a staging machine.
  • Use the snowflake_ga.sql DDL script to create the necessary staging tables and flattening views in your Snowflake data warehouse.
  • Load your JSON data files into their respective Snowflake tables using your preferred loading method.

Connect ThoughtSpot

  • Log into your ThoughtSpot instance and create an Embrace connection to each of the five views that have flattened the JSON data into a relational table structure.

Import TML

Combine all Worksheet TML files into a ZIP file:

  • Manifest_liveboard.yaml
  • Adwords Analysis - Google.worksheet.tml
  • Demographic Audience Anal.worksheet.tml
  • Geographic Audience Analy.worksheet.tml
  • Page Behaviour Analysis-.worksheet.tml
  • Site Statistics Analysis.worksheet.tml
  • Traffic Source analysis-.worksheet.tml

Combine all liveboard TML files into a ZIP file:

  • Manifest_liveboard.yaml
  • Acquisition - Adwords.pinboard.tml
  • Acquisition - Traffic Sou.pinboard.tml
  • Audience - Geographic Loc.pinboard.tml
  • Behaviour - Site Statisti.pinboard.tml
  • Behaviour - Page Analytic.pinboard.tml

Import the zipped file for the worksheets and verify that it has all been imported without any errors. Import the zipped for the liveboards and verify that it has all been imported without any errors.

Liveboard Screenshots

Adwords

Screen Shot 2022-03-30 at 9 27 11 AM

Traffic Sources

Screen Shot 2022-03-30 at 9 36 55 AM

Geographic Location

Screen Shot 2022-03-30 at 9 29 42 AM

Page Analytics

Screen Shot 2022-03-30 at 9 30 04 AM

Site Statistics

Screen Shot 2022-03-30 at 9 30 23 AM

About

Create a set of ThoughtSpot visualizations based on Google Analytics data hosted in Snowflake

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages