mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 13:07:59 +01:00
Made Google Analytics configurable, removed it outside of production, and corrected several namespace errors.
This commit is contained in:
parent
a4c24a7d64
commit
dc7c2786a8
11 changed files with 61 additions and 38 deletions
|
@ -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),
|
||||
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Track;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTrackHashes extends Migration
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Track;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateTrackHash extends Migration
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use App\Track;
|
||||
use Poniverse\Ponyfm\Track;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
|
||||
|
|
|
@ -2,10 +2,11 @@ window.pfm.preloaders = {}
|
|||
|
||||
module = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'pasvaz.bindonce', 'angularytics']
|
||||
|
||||
if window.pfm.environment == 'production'
|
||||
module.run [
|
||||
'Angularytics',
|
||||
(analyitcs) ->
|
||||
analyitcs.init()
|
||||
(analytics) ->
|
||||
analytics.init()
|
||||
]
|
||||
|
||||
module.config [
|
||||
|
@ -26,6 +27,7 @@ module.config [
|
|||
'/templates/directives/*'
|
||||
]
|
||||
|
||||
if window.pfm.environment == 'production'
|
||||
analytics.setEventHandlers ['Google']
|
||||
|
||||
# Errors
|
||||
|
|
|
@ -22,3 +22,5 @@ PONI_CLIENT_ID=null
|
|||
PONI_CLIENT_SECRET=null
|
||||
|
||||
PONYFM_DATASTORE=null
|
||||
|
||||
GOOGLE_ANALYTICS_ID=null
|
||||
|
|
|
@ -22,3 +22,5 @@ PONI_CLIENT_ID=
|
|||
PONI_CLIENT_SECRET=
|
||||
|
||||
PONYFM_DATASTORE=/vagrant-files
|
||||
|
||||
GOOGLE_ANALYTICS_ID=UA-29463256-1
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -32,7 +32,7 @@
|
|||
@if (Auth::check())
|
||||
<div class="user-details dropdown">
|
||||
<a class="avatar dropdown-toggle" href="#">
|
||||
<img src="{{Auth::user()->getAvatarUrl(\App\Image::THUMBNAIL)}}" />
|
||||
<img src="{{Auth::user()->getAvatarUrl(\Poniverse\Ponyfm\Image::THUMBNAIL)}}" />
|
||||
<span><i class="icon-chevron-down"></i></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
|
@ -112,14 +112,16 @@
|
|||
@else
|
||||
isLogged: false
|
||||
@endif
|
||||
}
|
||||
},
|
||||
environment: "{{ App::environment() }}"
|
||||
};
|
||||
</script>
|
||||
|
||||
@if(config('ponyfm.google_analytics_id'))
|
||||
<script>
|
||||
{{-- Google Analytics --}}
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-29463256-1']);
|
||||
_gaq.push(['_setAccount', '{{ config('ponyfm.google_analytics_id') }}']);
|
||||
_gaq.push(['_setDomainName', 'pony.fm']);
|
||||
|
||||
(function() {
|
||||
|
@ -128,6 +130,7 @@
|
|||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
|
||||
{!! Assets::scriptIncludes() !!}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<div class="player loading {{Auth::check() ? 'can-favourite' : ''}} {{$user['is_favourited'] ? 'favourited' : ''}}" data-track-id="{{ $track->id }}" data-duration="{{ $track->duration * 1000 }}">
|
||||
<div class="play" disabled="disabled">
|
||||
<div class="button"><i class="icon-play"></i></div>
|
||||
<img src="{{ $track->getCoverUrl(\App\Image::SMALL) }}" />
|
||||
<img src="{{ $track->getCoverUrl(\Poniverse\Ponyfm\Image::SMALL) }}" />
|
||||
</div>
|
||||
<div class="meta">
|
||||
@if (Auth::check())
|
||||
|
@ -52,9 +52,10 @@
|
|||
|
||||
{!! Assets::scriptIncludes('embed') !!}
|
||||
|
||||
@if(config('ponyfm.google_analytics_id'))
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-29463256-1']);
|
||||
_gaq.push(['_setAccount', '{{ config('ponyfm.google_analytics_id') }}']);
|
||||
_gaq.push(['_setDomainName', 'pony.fm']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
|
@ -64,5 +65,6 @@
|
|||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue