This app demonstrates how to track and record pageview events in an Angular (SPA) application.
- View the Medium article at Using Google Analytics with Angular
- Angular
- Google Analytics
-
Setup up a Google Analytics account.
-
Clone this repo:
git clone https://github.com/philipszdavido/google-analytics-with-angular.git
-
Move into the
google-analytics-with-angular
directory from the terminal:cd google-analytics-with-angular
-
Install the dependencies:
npm install
-
Open
index.html
in your editor, and change theUA-109919601-1
code to yours. -
Run the app:
ng serve
-
Navigate to
localhost:4200
in your browser. -
Click on the links
routeOne
routeTwo
and the buttonClick Me
to see Google Analytics record the events.
Why not star the github repo? The attention would be appreciated! How about sharing the link for this repo on Twitter?
Dont forget to follow me on Twitter!
Thanks! Chidume Nnamdi