Preview

Still need to add plots here. Describe below what kinds of plots may work for the data available

Data Information

Data information for google analytics metrics (ga_metrics):

Most of these metrics involve how users interact with a website or app, specifically in “event” terminology. Events are a means of measuring user interaction and can include actions like loading a page, clicking a link, submitting a form or requesting information, searches, shares content from. Do website creators need to define or add/create events to track for their website or is that automatic?

  • activeUsers: The number of distinct users who visited your website or application. An active user is any user who visited your website or application. An active user is any user who has an engaged session or when Analytics collects parameters from a website or app indicative of a first time or active user.
  • newUsers: The number of new unique user IDs that logged the first_open or first_visit event. The metric allows you to measure the number of users who interacted with your site or launched your app for the first time.
  • totalUsers: The number of unique user IDs that triggered any events. The metric allows you to measure the number of unique users who logged an event.
  • eventCountPerUser: The average number of events triggered per user. Specifically the event count divided by the number of active users. The event count in turn is the number of times users triggered an event.
  • screenPageViewsPerUser: The average number of mobile app screens or web pages viewed per user. This would then be the total number of views (screenPageViews) divided by the total number of users (totalUsers)
  • sessions: The number of sessions that began on your website or application. A session is a period of time during which a user interacts with your website or app. A session initiates when a user either opens your app in the foreground or views a page or screen and no session is currently active (e.g., their previous session has timed out). By default, a session ends (times out) after 30 minutes of user inactivity. There is no limit to how long a session can last.
  • averageSessionDuration: The average duration (in seconds) of users’ sessions.
  • screenPageViews: The number of mobile app screens or web pages your users saw. Repeated views of a single screen or page are counted.
  • engagementRate: The percentage of sessions that were engaged sessions. Specifically, the number of engaged sessions divided by the total number of sessions. An engaged session is a session that lasts 10 seconds or longer or has 1 or more conversion events or 2 or more page or screen views. (A conversion event is any user action that’s valuable to your business and is defined by marking the event as a conversion. This is in contrast to most other metrics that are populated automatically.)
knitr::kable(ga_metrics)
website activeUsers newUsers totalUsers eventCountPerUser screenPageViewsPerUser sessions averageSessionDuration screenPageViews engagementRate
dummy-website-2 3 3 3 4.333333 1.0 3 3.610206 3 0.0
dummy-website 5 5 5 14.000000 3.8 8 42.782559 19 0.5

In the preview section above: Add plots that are like Figures 9 and 10 from the ITN evaluation

Data information for google analytics dimensions (ga_dimensions):

  • website: Indicates the name of the website associated with that session.
  • day: Indicates the day of the session
  • month: Indicates the month of the session
  • year: Indicates the year of the session
  • country: Indicates the country from which a session originates
  • fullPageURL: Indicates full page URL of the page that is viewed in that session.
knitr::kable(ga_dimensions)
website day month year country fullPageUrl
dummy-website-2 11 01 2024 Germany metricminer.github.io/my-cool-repo/
dummy-website-2 11 01 2024 United States metricminer.github.io/my-cool-repo/
dummy-website-2 14 03 2024 United States metricminer.github.io/my-cool-repo/
dummy-website 10 01 2024 Germany metricminer.github.io/dummy-website/
dummy-website 10 01 2024 Russia metricminer.github.io/dummy-website/
dummy-website 10 01 2024 United States metricminer.github.io/dummy-website/
dummy-website 14 03 2024 United States metricminer.github.io/dummy-website/
dummy-website 15 03 2024 United States metricminer.github.io/dummy-website/

In the preview section above: Add a plot that shows a map and distribution of countries? (though this might not generalize well) or Add a plot that shows traffic over time

Data information for google analytics link clicks (ga_link_clicks):

  • website: Indicates the website on which the outbound click event occurred
  • linkURL: Indicates the URL for the outbound click. What does NA mean for this – a random click on the website?
knitr::kable(ga_link_clicks)
website linkUrl
dummy-website-2 NA
dummy-website-2 https://www.metricminer.org/
dummy-website NA
dummy-website https://www.metricminer.org/

Setting up Google Analytics

Grab information from vignette

Customization

Customizing Google Analytics Data

Google Analytics explains that each dimension and metric that can be collected and reported has a scope (user-, session-, or hit-level) and in most cases, only dimensions and metrics that share the same scope can be combined.

To learn more about about Google Analytics in general, visit the google analytics documentation, and visit your own dashboard to customize and explore the possibilites of what you can collect.

Plots

Review ggplot2 documentation for customization of plots visit the ggplot2 documentation here or look at this posit cheatsheet.

Setting up Google Analytics

Follow the steps from the above section to authenticate Google – make sure that the account you have authenticated for has access to the Google Analytics properties you wish to collect.

We’ll need to collect the Google Analytics property IDs for the websites you want to retrieve data from.

  1. Go to https://analytics.google.com/ – You may have to login. These instructions are assuming you have already set up Google Analytics and have been collecting data.
  2. Then click on the website at the top of the navbar. It will bring you to a dropdown that shows all your websites.

4 .Click on one of the websites where you’d like to retrieve data from. The URL will look something like this:

https://analytics.google.com/analytics/web/?authuser=1#/p<PROPERTY_ID_HERE>/reports/home
  1. Copy the property id and put it in the ga_property_ids: part of the _config_automation.yml.

Repeat these same steps for all the properties you’d like to collect data for, separating the IDs by commas. Delete the example IDs we have put there as placeholders.

###### Google Analytics ######
refresh-ga: yes
ga_property_ids: [ 422671031, 422558989 ]
ga_googlesheet:
  • In the config_automation.yml file, make sure that refresh-ga is set to “yes”.
  • Optionally, if you are saving data to Google, specify a googlesheet ID in ga_googlesheet you’d like the GitHub data to be saved to. This will only be relevant if you’ve set data_dest to google.

Customizing the data

In order to customize the data you are downloading from Google Analytics you can modify the refresh-scripts/refresh-ga.R script in your repository.

You can take a look at the metricminer R package documentation for more details about the functions and what is possible.

If you have a metric need that is not currently fulfilled by metricminer or metricminer-dashboard we encourage you to file a GitHub issue with us and let us know about your new feature idea (or bug report).