• Stars
    star
    1,389
  • Rank 33,658 (Top 0.7 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A showcase of demos and tools built with the various Google Analytics APIs and Libraries.

GA Demos & Tools

A showcase of demos and tools built with the various Google Analytics APIs and Libraries. View the Site

Submitting Feedback / Reporting Bugs

For the Demos & Tools site

For the Google Analytics platform

  • Documentation for all Google Analytics API, libraries and SDKs can be found on Google Analytics Developers.
  • If you have questions, please refer to the getting help section of the developers site to find the best place to get your questions answered.

Building and running the site locally

Requirements

  • Yarn

    This site is only tested and developed using yarn.

Running

To run the site locally, first make sure you have all the dependencies installed:

yarn

Also make sure to install the dependencies in the lib directory.

cd lib
yarn
cd ..

Then run the following (from the top level directory) and answer all prompts:

yarn start:app:production

All prompts can be skipped, but certain demos rely on prompt answers to fully function. Notably, any demo that requries authentication will require you to put in a valid Google client ID.

This will set up a local hot-reloading instance of the app that can try out at http://localhost:5000

Testing

To run tests, first make sure you have all the dependencies installed:

yarn

Then run the following:

yarn test

Whats in this repo

./src

This is where the majority of the client-side code lives. All of our demo code can be found here.

./gatsby-browser.js

This file is useful to decorate our app with functionality that is needed at runtime.

Of note, we use:

  • wrapRootElement

    Lets us wrap the root element in any necessary context/providers. We use it for injecting a material-ui Theme provider, and a Redux store.

  • onInitialClientRender

    Any code that should run once after the client renders goes here.

    This code pulls in and configures gapi, a Google library that makes calling Google APIs from javascript a breeze.

Also see Gatsby browser APIs.

gatsby-config.js

This is the main configuration file for our Gatsby site. All of our gatsby plugins are configured here.

  • gatsby-plugin-prefetch-google-fonts

    Allows us to download/prefetch Google Fonts. From their docs: "Can increase performance as opposed to loading webfonts from Google's external stylesheet."

  • gatsby-plugin-react-svg

    Makes it easy to load in SVGs as React components via the following stanza:

    import SVGComponentName from "-!svg-react-loader!../images/svg-name.svg"
    
  • gatsby-plugin-typescript

    Provides drop-in support for Typescript and TSX. <opinion>For a site like this, with demos that will live over many years, typescript is a handy way to make it easier to jump back in the code.</opinion>

  • gatsby-source-filesystem

    Lets us source data into the app that can be queried via graphql.

Also see Gatsby Config API.

More Repositories

1

autotrack

Automatic and enhanced Google Analytics tracking for common user interactions on the web.
JavaScript
4,925
star
2

google-analytics-plugin-for-unity

Google Analytics plugin for the Unity game creation system
C#
388
star
3

google-analytics-super-proxy

Publicly share your Google Analytics reporting data.
Python
224
star
4

ga4-tutorials

HTML
91
star
5

bigquery-export-ipython-notebooks

70
star
6

hello-world-android-app

Java
48
star
7

javascript-api-utils

JavaScript
44
star
8

gav4-python

A library for converting Google Analytics Core Reporting API V3 request to Analytics Reporting API V4 requests.
Python
39
star
9

gtm-consent-mode-examples

Google Tag Manager Consent Mode Examples
Smarty
35
star
10

google-analytics-magic-script

JavaScript
32
star
11

cute-pets-example-android-app

Java
29
star
12

analytics-samples-config

Google Analytics Sample Code for Configuration APIs
JavaScript
27
star
13

hello-world-ios-app

Objective-C
20
star
14

legacy-samples

Legacy samples migrated from code.google.com
HTML
17
star
15

google-tag-manager-ios-sdk

Swift
12
star
16

cute-pets-example-ios-app

Objective-C
12
star
17

ecommerce-migration-helper

JavaScript
12
star
18

python-docs-samples

Python
12
star
19

analytics-data-javascript-examples

10
star
20

dotnet-docs-samples

C#
9
star
21

analytics-data-curl-examples

Shell
9
star
22

nodejs-analyticsadmin

Google Analytics Admin API client library source for Node.js.
JavaScript
7
star
23

AppsFlyerWrapperAndroid

Java
6
star
24

firebase-analytics-cordova

A cordova plugin that provides Firebase Analytics to Cordova apps
Java
4
star
25

AdjustWrapperAndroid

Java
3
star
26

AppsFlyerWrapperIOS

Helper library to easily send information to both the AppsFlyer and Google Analytics for Firebase backends.
Objective-C
3
star
27

php-docs-samples

PHP
3
star
28

java-docs-samples

Java
3
star
29

typo3-gtag-integration

PHP
2
star
30

AdjustWrapperIOS

Objective-C
2
star
31

.github

1
star
32

.allstar

1
star
33

nodejs-docs-samples

JavaScript
1
star