Skip to content

Commit

Permalink
Merge pull request #179 from europeana/feat/MET-6011-Matomo-Enhancements
Browse files Browse the repository at this point in the history
MET-6011 Use Matomo Router
  • Loading branch information
andyjmaclean authored Jul 26, 2024
2 parents ccb4820 + a2701ff commit 1b4027b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OverviewComponent } from './overview/overview.component';
import { LandingComponent } from './landing/landing.component';
import {
MatomoRouterModule,
MatomoRouteDataInterceptor
} from 'ngx-matomo-client';
import { CountryComponent } from './country/country.component';

const pageTitle = 'Statistics Dashboard';
const routes: Routes = [
{
title: `${pageTitle} | Filters`,
path: 'country/:country',
component: CountryComponent
},
Expand All @@ -15,25 +21,34 @@ const routes: Routes = [
},
{
path: 'cookie-policy',
title: `${pageTitle} | Cookie Policy`,
loadComponent: async () =>
(await import('./cookie-policy/cookie-policy.component'))
.CookiePolicyComponent
},
{
path: 'privacy-statement',
title: `${pageTitle} | Privacy Policy`,
loadComponent: async () =>
(await import('./privacy-statement/privacy-statement.component'))
.PrivacyStatementComponent
},
{
title: pageTitle,
path: '',
component: LandingComponent
},
{ path: '**', redirectTo: '', pathMatch: 'full' }
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [
RouterModule.forRoot(routes),
MatomoRouterModule.forRoot({
// Declare built-in MatomoRouteDataInterceptor
interceptors: [MatomoRouteDataInterceptor]
})
],
exports: [RouterModule]
})
export class AppRoutingModule {}

0 comments on commit 1b4027b

Please sign in to comment.