Skip to content

Commit

Permalink
Merge pull request #387 from wdwatkins/master
Browse files Browse the repository at this point in the history
namespace analytics vars, bump version
  • Loading branch information
aappling-usgs authored Jul 20, 2018
2 parents 5338518 + e8efc84 commit fa34f05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Description: Provides utility functions to organize, develop, and publish
web-based data visualizations.
Expand Down
13 changes: 7 additions & 6 deletions inst/templates/fullPage.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
</script>
{{/analytics-id}}
Expand Down

0 comments on commit fa34f05

Please sign in to comment.