From b4bedf891a86ffc0571d1be487cf1d4e7260b5ec Mon Sep 17 00:00:00 2001 From: samreid Date: Fri, 26 Feb 2021 07:40:59 -0700 Subject: [PATCH] Apply WebStorm formatting, see https://github.com/phetsims/phet-info/issues/155 --- js/analytics/google-analytics.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/js/analytics/google-analytics.js b/js/analytics/google-analytics.js index 72cfb199..57fd5a56 100644 --- a/js/analytics/google-analytics.js +++ b/js/analytics/google-analytics.js @@ -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' ); @@ -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 = {};