Skip to content

Commit

Permalink
Apply WebStorm formatting, see phetsims/phet-info#155
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2021
1 parent e5ca652 commit b4bedf8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions js/analytics/google-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,23 @@

// {boolean} - Whether analytics.js successfully loaded, see https://github.com/phetsims/yotta/issues/30
let googleAnalyticsLoaded = false;

function onGoogleAnalyticsLoad() {
googleAnalyticsLoaded = true;
}

const pingParams = 'pingver=3&' +
'project=' + encodeURIComponent( phet.chipper.project ) + '&' +
'brand=' + encodeURIComponent( phet.chipper.brand ) + '&' +
'version=' + encodeURIComponent( phet.chipper.version ) + '&' +
'locale=' + encodeURIComponent( phet.chipper.locale ) + '&' +
'buildTimestamp=' + encodeURIComponent( phet.chipper.buildTimestamp ) + '&' +
'domain=' + encodeURIComponent( document.domain ) + '&' +
'href=' + encodeURIComponent( window.location.href ) + '&' +
'type=html&' +
'timestamp=' + encodeURIComponent( Date.now() ) + '&' +
'loadType=' + encodeURIComponent( loadType ) + '&' +
'ref=' + encodeURIComponent( document.referrer );
'project=' + encodeURIComponent( phet.chipper.project ) + '&' +
'brand=' + encodeURIComponent( phet.chipper.brand ) + '&' +
'version=' + encodeURIComponent( phet.chipper.version ) + '&' +
'locale=' + encodeURIComponent( phet.chipper.locale ) + '&' +
'buildTimestamp=' + encodeURIComponent( phet.chipper.buildTimestamp ) + '&' +
'domain=' + encodeURIComponent( document.domain ) + '&' +
'href=' + encodeURIComponent( window.location.href ) + '&' +
'type=html&' +
'timestamp=' + encodeURIComponent( Date.now() ) + '&' +
'loadType=' + encodeURIComponent( loadType ) + '&' +
'ref=' + encodeURIComponent( document.referrer );

function pingURL( url ) {
const img = document.createElement( 'img' );
Expand All @@ -99,16 +100,16 @@
}, false );

// Google Analytics snippet for loading the API
(function( i, s, o, g, r, a, m ) {
( function( i, s, o, g, r, a, m ) {
i.GoogleAnalyticsObject = r;
i[ r ] = i[ r ] || function() {
(i[ r ].q = i[ r ].q || []).push( arguments );
( i[ r ].q = i[ r ].q || [] ).push( arguments );
}, i[ r ].l = 1 * new Date();
a = s.createElement( o ), m = s.getElementsByTagName( o )[ 0 ];
a.async = 1;
a.src = g;
m.parentNode.insertBefore( a, m );
})( window, document, 'script', ( 'https:' === document.location.protocol ? 'https:' : 'http:' ) + '//www.google-analytics.com/analytics.js', 'googleAnalytics' );
} )( window, document, 'script', ( 'https:' === document.location.protocol ? 'https:' : 'http:' ) + '//www.google-analytics.com/analytics.js', 'googleAnalytics' );

// Applies custom dimensions that are common for our main, third-party, and phet-io tracker
const phetPageviewOptions = {};
Expand Down

0 comments on commit b4bedf8

Please sign in to comment.