From ed4b3d2e21b407b06ce5f7ca200c63c14b261f79 Mon Sep 17 00:00:00 2001 From: wdwatkins Date: Fri, 20 Jul 2018 09:44:51 -0500 Subject: [PATCH 1/2] namespacing in analytics snippet --- inst/templates/fullPage.mustache | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inst/templates/fullPage.mustache b/inst/templates/fullPage.mustache index dbecd2f..b58c400 100644 --- a/inst/templates/fullPage.mustache +++ b/inst/templates/fullPage.mustache @@ -19,18 +19,19 @@ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments)}; gtag('js', new Date()); - function getTimestamp() {return new Date().getTime().toString()} - function getSessionId() {return new Date().getTime() + '.' + Math.random().toString(36).substring(5)} - var sessionId = getSessionId(); - var timestamp = getTimestamp(); + 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': sessionId, - 'timestamp': timestamp + 'sessionId': analytics.sessionId, + 'timestamp': analytics.getTimestamp() }); {{/analytics-id}} From e8efc846ccd48836d86356df87f166201871ad6d Mon Sep 17 00:00:00 2001 From: wdwatkins Date: Fri, 20 Jul 2018 09:45:02 -0500 Subject: [PATCH 2/2] bump up version --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9c84284..8b90bc1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: vizlab Type: Package Title: Utilities for building online data visualizations -Version: 0.3.6 -Date: 2018-05-24 -Author: Jordan Walker, Alison Appling, Lindsay Carr, Luke Winslow, Jordan Read, Laura DeCicco, Marty Wernimont +Version: 0.3.7 +Date: 2018-07-20 +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.