Skip to content

Latest commit

 

History

History
98 lines (69 loc) · 3.66 KB

analytics.org

File metadata and controls

98 lines (69 loc) · 3.66 KB

Analytics

Introduction

This document describes the analytics information included in a lab and experiment page.

The Lab and Experiment pages are tracked for analytics information using the google analytics service. This service keeps track usage information for each page in a given domain. Currently we collect analytics for labs hosted in the vlabs.ac.in domain.

The reporting of analytics is done using googld data studio reports and is publically available here.

The setup for tracking analytics is done using google tag manager.

Tag Manager Container: GTM-W59SWTR

Mechanism for Collecting Analytics

There are two types of information collected for any page by google analytics:

predefined variable
Predefined/inbuilt variables are things like page url, timestamp etc which is common to all webpages. No configuration is required for these variables.
user defined variables
These variables are used to store additional information related to the page. For example, in an experiment level page, the experiment name is stored in a user defined variable. The Datalayer facility of google tag manager is used to create these variables.

In the next two sections we discuss the datalayer variables for Lab and Experiment level pages.

Analytics Setup in pages

In order to track any page using google analytics, we need to add two scripts in the page.

Header Script

The header script contains some javascript code provided by google tag manager along with the dataLayer object.

Refer to the Html templates for header scripts in lab and experiment pages for details.

NOTE: The code in the header scripts include the GTM container ID. It has been hardcoded in the templates and will need to be changed in the unlikely event that the container ID changes.

Body Snippet

The body snippet needs to be added at the top of the body (first child of the body element).

This snippet also contains the GTM container ID and will have to change when the container ID changes.

The body snippet for the lab pages is included in the skeleton-new.html document which is the common template for all lab pages.

The body snippet for the experiment pages is included in the analytics-body.handlebars template.

Lab Analytics

VARIABLEDESCRIPTION
labNameName of the Lab
disciplineSubject Domain of the Lab
collegeCollege Code
phasePhase Number of the Lab

All of these fields are given in the lab-descriptor document.

Experiment Analytics

VARIABLEDESCRIPTION
labNameName of the Lab
disciplineSubject Domain of the Lab
collegeCollege Code
phasePhase Number of the Lab
expNameExperiment Name
expShortNameExperiment Short Name

All of these fields are given in the lab-descriptor.

NOTE: Please get all the fields verified before building a lab.