• Stars
    star
    121
  • Rank 284,041 (Top 6 %)
  • Language
    R
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

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

Repository Details

A demo on how to build your own Google Analytics dashboard with R, Shiny and MySQL

ga-dashboard-demo

A demo on how to build your own Google Analytics dashboard with R, Shiny and MySQL

A guide blogpost here: http://markedmondson.me/enhance-your-google-analytics-data-with-r-and-shiny-free-online-dashboard-template

Live demo version here: https://mark.shinyapps.io/GA-dashboard-demo

Intro

Whilst shinyga() lets you create Shiny dashboards that anyone can connect their own GA data with, the more common use case of creating a dashboard to use just your own data is better served by this example. This template lets you clone and enter your GA id to quick start your own Shiny dashboard.

Features

  • Interactive trend graph.
  • Auto-update of GA data for last 3 years.
  • Zoomable heatmap for Day of week analysis.
  • Year on Year, Month on Month and Last Month vs same Month Last Year.
  • MySQL persistant storage for data blending your data with GA data.
  • Upload option to update MySQL data stored.
  • Analysis of impact of events on your GA data via Google's CausalImpact
  • Detection of unusual timepoints using Twitter's AnomalyDetection

Screenshots

Trend Upload to MySQL Analysis of data

To Use

  1. Clone this repository to your own RStudio project.
  2. Get your MySQL setup with a user and IP location, and the GA View ID you want to pull data from. You will also probably need to whitelist the IP of your Shiny Server. Add your local IP for testing too. If you will use shinyapps.io their IPs are:
  • 54.204.29.251
  • 54.204.34.9
  • 54.204.36.75
  • 54.204.37.78
  1. Create another file called secrets.r file in the same directory with the below content filled in with your details. This file is called in functions.r

     # secrets.r
     options(mysql = list(
     "host" = "YOUR SQL IP",
     "port" = 3306,
     "user" = "YOUR SQL USER",
     "password" = "YOUR USER PW",
     "databaseName" = "onlinegashiny"),
     rga = list(
     "profile_id" = "YOUR GA ID",
     "daysBackToFetch" = 356*3
     ),
     shinyMulti = list(
     "max_plots" = 10
     ),
     myCausalImpact = list(
     'test_time' = 14,
     'season' = 7
     ),
     shiny.maxRequestSize = 0.5*1024^2 ## upload only 0.5 MB
     )
    
  2. Install rga() if you need to, then run the below once locally in the same folder to have the app remember your GA OAuth2 settings.

     ## Run this locally first, to store the auth token.
     library(rga)
     rga::rga.open(where="token.rga")
    
  3. Run locally with shiny::runApp() or upload to your shinyapps.io account or your own Shiny server.

  4. Customise your instance.

More Repositories

1

googleAuthR

Google API Client Library for R. Easy authentication and help to build Google API R libraries with OAuth2. Shiny compatible.
R
169
star
2

searchConsoleR

R interface with Google Search Console API v3, including Search Analytics.
R
110
star
3

gentelellaShiny

R
95
star
4

googleCloudRunner

Easy R scripts on Google Cloud Platform via Cloud Run, Cloud Build and Cloud Scheduler
R
78
star
5

serverless-R-API-appengine

Describes how to deploy an R API using Plumber onto App Engine and using Cloud Endpoints
R
77
star
6

langchain-github

Python
65
star
7

Shiny-R-SaaS

Bootstrap a paid R SaaS using Shiny, Firebase and Paddle
R
60
star
8

BigQuery-Visualiser

A Shiny app to visualise BigQuery data in R. Open sourced so you can deploy on your own Shiny server.
R
49
star
9

edmonbrain

A Langchain driven project to create flexible LLM bots on Google Cloud Platform
Python
37
star
10

shinyga

shinyga - Shiny Google Authentication. Quick start user authentication for Google Analytics
R
35
star
11

dartistics.com

Tutorial R website tailored for digital web analysts
HTML
31
star
12

cloudRunR

Running R on Cloud Run
R
31
star
13

ga-bq-stream

Stream JSON data into BigQuery
Python
30
star
14

autoGoogleAPI

Unofficial Google R packages. These are a collection of Google API R packages auto-generated by googleAuthR v0.5
R
25
star
15

code-examples

Code for Learning Google Analytics book
Python
24
star
16

gago

Google Analytics for Go
Go
22
star
17

predictClickOpenCPU

Code for the prediction example from user webpages
HTML
20
star
18

googleMeasureR

Send tracking hits to Google Analytics from R code using the Google Analytics Measurement Protocol
R
17
star
19

youtubeAnalyticsR

YouTube Analytics API into R
R
17
star
20

appengine-shiny

Looking at deploying Shiny apps on Google App Engine with flexible containers
R
17
star
21

googleID

Authentication and identifying Google users using Google+ API
R
14
star
22

verbal_ga_shiny

Talking Google Analytics reports in Shiny
R
14
star
23

google-analytics-cloud-functions

Some cloud functions helpful to Google Analytics
Python
12
star
24

appengine-rstudio

Experiment deploying Rstudio to Google AppEngine
11
star
25

realtimeShiny

R
9
star
26

stripeR

Interface between Stripe API and R
R
8
star
27

r-twitter-api-ggplot2

Demo plotting Twitter API data in R, using library(ggplot2) and library(twitteR)
R
8
star
28

ga-get-to-post

Call me a GET gif with the correct parameters and you get a POST to your GA account
Python
6
star
29

gtm-redirect-tracker

Track in GTM Server Side using redirects
Smarty
6
star
30

docker-shiny-server

Shiny Server for me
6
star
31

gtmR

R
6
star
32

unsampledGAData

A simple Shiny app to request unsampled GA data
R
6
star
33

edmonlytica-browser-template

Edmonlytica is a proof of concept for making your own digital analytics stream using GTM Server Side and BigQuery.
Smarty
6
star
34

gentelellaShiny_nopackage

gentelella bootstrap theme as a Shiny HTML template
HTML
5
star
35

edmonlytica-server-side-client

Edmonlytica is a proof of concept for making your own digital analytics stream using GTM Server Side and BigQuery.
Smarty
4
star
36

antiFakeNews

R
4
star
37

measurementProtocol

Use R to send server-side tracking data to Google Analytics 4. https://developers.google.com/analytics/devguides/collection/protocol/ga4
R
4
star
38

MarkEdmondson1234.github.io

Website
HTML
2
star
39

alphago

Animated visualisations of historical Go matches
R
2
star
40

edmonlytica-server-side-tag

Edmonlytica is a proof of concept for making your own digital analytics stream using GTM Server Side and BigQuery.
Smarty
2
star
41

r-code-commit-github

Example of running R code on a schedule to commit a file to GitHub
2
star
42

timehumps

Examine how sources influence others over time
R
2
star
43

MarkEdmondson1234

Me
2
star
44

anomaly_detection_Rmail_alert

This script pulls time series data from Mixpanel and checks to see whether anomalies are present using Twitters AnomalyDetection package in R
R
2
star
45

entropyMatrixViz

Visualisation of matrix binary grids entropy
R
1
star
46

googleAnalyticsRv4Demo

R
1
star
47

ga_model_pins

ga_models that can be fetched with library(pins)
1
star
48

gdelt_brand_monitoring

Exploring if brand monitoring is doable using GDELT
R
1
star
49

utilities

Helpful functions
R
1
star
50

dotfiles

Its my dotfiles
1
star
51

shiny-real-time-chart

R
1
star