diff --git a/DESCRIPTION b/DESCRIPTION index 0580af5..61be0b7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: vizlab Type: Package Title: Utilities for building online data visualizations -Version: 0.3.7 -Date: 2018-07-06 -Author: Jordan Walker, Alison Appling, Lindsay Carr, Luke Winslow, Jordan Read, Laura DeCicco, Marty Wernimont +Version: 0.3.8 +Date: 2018-08-07 +Author: Jordan Walker, Alison Appling, Lindsay Carr, Luke Winslow, Jordan Read, Laura DeCicco, Marty Wernimont, David Watkins Maintainer: Alison Appling Description: Provides utility functions to organize, develop, and publish web-based data visualizations. diff --git a/inst/templates/fullPage.mustache b/inst/templates/fullPage.mustache index 5a03042..b58c400 100644 --- a/inst/templates/fullPage.mustache +++ b/inst/templates/fullPage.mustache @@ -19,13 +19,19 @@ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments)}; gtag('js', new Date()); - + var analytics = { + sessionId: (new Date().getTime() + '.' + Math.random().toString(36).substring(5)), + getTimestamp: function(){return new Date().getTime().toString()} + } + gtag('config', '{{ . }}', { 'custom_map': { 'dimension1': 'clientId', 'dimension2': 'sessionId', 'dimension3': 'timestamp' - } + }, + 'sessionId': analytics.sessionId, + 'timestamp': analytics.getTimestamp() }); {{/analytics-id}}