mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 13:03:04 +00:00
50479: Added google analytics support
This commit is contained in:
@@ -14,6 +14,8 @@ import { AppComponent } from '../../app/app.component';
|
||||
import { AppModule } from '../../app/app.module';
|
||||
import { DSpaceBrowserTransferStateModule } from '../transfer-state/dspace-browser-transfer-state.module';
|
||||
import { DSpaceTransferState } from '../transfer-state/dspace-transfer-state.service';
|
||||
import { Angulartics2Module } from 'angulartics2';
|
||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
||||
|
||||
export function createTranslateLoader(http: HttpClient) {
|
||||
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
|
||||
@@ -34,6 +36,7 @@ export function createTranslateLoader(http: HttpClient) {
|
||||
preloadingStrategy:
|
||||
IdlePreload
|
||||
}),
|
||||
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics]),
|
||||
BrowserAnimationsModule,
|
||||
DSpaceBrowserTransferStateModule,
|
||||
TranslateModule.forRoot({
|
||||
|
@@ -16,10 +16,16 @@ import { DSpaceTransferState } from '../transfer-state/dspace-transfer-state.ser
|
||||
|
||||
import { TranslateUniversalLoader } from '../translate-universal-loader';
|
||||
|
||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
||||
|
||||
export function createTranslateLoader() {
|
||||
return new TranslateUniversalLoader('dist/assets/i18n/', '.json');
|
||||
}
|
||||
|
||||
class AngularticsMock {
|
||||
public eventTrack(action, properties) { }
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
bootstrap: [AppComponent],
|
||||
imports: [
|
||||
@@ -42,6 +48,7 @@ export function createTranslateLoader() {
|
||||
AppModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: Angulartics2GoogleAnalytics, useClass: AngularticsMock }
|
||||
]
|
||||
})
|
||||
export class ServerAppModule {
|
||||
|
Reference in New Issue
Block a user