Posts

Showing posts with the label Google Analytics

Adding Google Analytics in Angular 8

Image
As we all know, Google Analytics is the most used site analytics tool. It helps developers and site admins to keep track of user activities in their website and also it offers many features for us to evaluate our site's performance. An Angular app is a Single Page Application (SPA) and Google Analytics isn't designed to work with Single Page Applications. Let's see how we can add Google Analytics in Angular Application. Step 1 : Create and Configure an Angular App Create an Angular App by running the command ng new SampleApp Type y  when it prompts whether routing should be enabled or not and choose your preferred style format. This will create an Angular App "SampleApp" and install all the dependencies in it. Now let's add some pages and set routing in our app. We are creating 2 components, home and test .  Type the following command to create 2 components ng g c home && ng g c test This will create 2 compone...