diff --git a/config/ponyfm.php b/config/ponyfm.php index e10a1967..1203dd76 100644 --- a/config/ponyfm.php +++ b/config/ponyfm.php @@ -28,4 +28,16 @@ return [ 'sendfile' => env('USE_SENDFILE', true), + /* + |-------------------------------------------------------------------------- + | Google Analytics ID + |-------------------------------------------------------------------------- + | + | If provided, Pony.fm will track activity in the given Google Analytics + | profile. + | + */ + + 'google_analytics_id' => env('GOOGLE_ANALYTICS_ID', null), + ]; diff --git a/database/migrations/2013_09_23_031316_create_track_hashes.php b/database/migrations/2013_09_23_031316_create_track_hashes.php index 6fe14832..cdfe0323 100644 --- a/database/migrations/2013_09_23_031316_create_track_hashes.php +++ b/database/migrations/2013_09_23_031316_create_track_hashes.php @@ -1,6 +1,6 @@ dropColumn('hash'); }); } -} \ No newline at end of file +} diff --git a/database/migrations/2014_05_28_071738_update_track_hash.php b/database/migrations/2014_05_28_071738_update_track_hash.php index 6f2d43bb..c3dca55d 100644 --- a/database/migrations/2014_05_28_071738_update_track_hash.php +++ b/database/migrations/2014_05_28_071738_update_track_hash.php @@ -1,6 +1,6 @@ - analyitcs.init() -] +if window.pfm.environment == 'production' + module.run [ + 'Angularytics', + (analytics) -> + analytics.init() + ] module.config [ '$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider', '$httpProvider', '$sceDelegateProvider' @@ -26,7 +27,8 @@ module.config [ '/templates/directives/*' ] - analytics.setEventHandlers ['Google'] + if window.pfm.environment == 'production' + analytics.setEventHandlers ['Google'] # Errors state.state 'errors-404', @@ -245,4 +247,4 @@ module.config [ $dialogProvider.options dialogFade: true backdropClick: false -] \ No newline at end of file +] diff --git a/resources/environments/.env.example b/resources/environments/.env.example index b0321a00..3e28b6b7 100644 --- a/resources/environments/.env.example +++ b/resources/environments/.env.example @@ -22,3 +22,5 @@ PONI_CLIENT_ID=null PONI_CLIENT_SECRET=null PONYFM_DATASTORE=null + +GOOGLE_ANALYTICS_ID=null diff --git a/resources/environments/.env.local b/resources/environments/.env.local index f0f884bf..4b58c75c 100644 --- a/resources/environments/.env.local +++ b/resources/environments/.env.local @@ -22,3 +22,5 @@ PONI_CLIENT_ID= PONI_CLIENT_SECRET= PONYFM_DATASTORE=/vagrant-files + +GOOGLE_ANALYTICS_ID=UA-29463256-1 diff --git a/resources/environments/.env.production b/resources/environments/.env.production index bcc7bf00..49e132d8 100644 Binary files a/resources/environments/.env.production and b/resources/environments/.env.production differ diff --git a/resources/environments/.env.stage b/resources/environments/.env.stage index 199dcfa4..7f820962 100644 Binary files a/resources/environments/.env.stage and b/resources/environments/.env.stage differ diff --git a/resources/views/shared/_app_layout.blade.php b/resources/views/shared/_app_layout.blade.php index 1f0287c5..cb769311 100644 --- a/resources/views/shared/_app_layout.blade.php +++ b/resources/views/shared/_app_layout.blade.php @@ -32,7 +32,7 @@ @if (Auth::check())