Skip to content

Commit

Permalink
fix: set page event
Browse files Browse the repository at this point in the history
  • Loading branch information
guiseek committed Dec 9, 2024
1 parent a70516a commit a9ef8a1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ export class AnalyticsService {
}

#sendPage(url: string) {
// Won't re-send if the url hasn't changed.
if (url === this.previousUrl) {
return;
}
this.previousUrl = url;

this.#gtag('event', 'page_view', {
page_location: location.href,
page_path: this.previousUrl,
page_title: document.title,
});
}

#gtag(...args: unknown[]) {
Expand Down

0 comments on commit a9ef8a1

Please sign in to comment.