This post is an introduction to the Google API and how to use it to create a dashboard using Google Analytics.
It is a very basic tutorial that does not cover the full power of the API but will cover most of the basics to get you started.
In this post I will be using the following Google Analytics modules: google-analytics-gcm-categories,google-analytic-gcc-categorical,google.analytics.ga.gcm,google._ga_categories_api,google_analytics_ga_products_catego.
The first two Google Analytics APIs are great to get started with but they are not as powerful as the Google Cloud Platform Analytics API (GCAP) as it is limited to a single API call per project.
I will be building a simple Google Analytics dashboard for a small ecommerce site that uses Google Cloud API (GCP) for all of its backend data.
This example project is a one-off project that has been created to test out the Google analytics dashboard using the GCP API.
You can use the following code to get your Google Analytics data and code snippet ready to use in the Google dashboard: import requests,json,response from django.db import models from djangoproject import django_query_string from djadb import client import urllib3,googleapi from djads import client,model_loader from djwsgi import webgl,googlegl import geocoder as geocode from google.analytic.gce_products import GoogleGCE_Products from google_analytic_gcm import GoogleAnalyticGcmCategory from googleapi.ga import GoogleGA_Products as GA_Products def setup(request,response): try: db = requests.get( ‘https://api.googleapis.com/v1/ga/products/1’ , json=response.headers[‘Authorization’]).get() except Exception as e: print(e) if __name__ == ‘__main__’: app = app.run() else: app.start() print( ‘Getting data’ ) data = json.loads(client) geocoding = geocoders.get_global_geo() geocoded_data = data[‘data’][‘location’] geocodes = geodocers.geocode(geocodered_data[‘location’] + location) print(geos = geos.get()) print( geocopies = geopies.get()) print(code = code.get(‘code’) + ‘)’ ) app.stop()