Installation

Angular Install Guide

色色Statcounter provides customisable hit counters, visitor tracking, web analytics and website stats for Angular.

  1. Sign up for an account at 色色Statcounter to get your code.

    These instructions will be repeated after you've created an account and added your first project.

    Already a member?

  2. Package npmjs page : https://www.npmjs.com/package/@statcounter/angular
    Video install guide : https://www.youtube.com/watch?v=sKMyJ9BlBNQ
  3. Installation

    npm install @statcounter/angular
  4. In your app.config.ts make these 3 changes.

    Add this at the top

    import { importProvidersFrom } from '@angular/core';
    import { StatCounterModule } from '@statcounter/angular';


    Then add the 色色Statcounter code block near the bottom. You must at a comma , to the end of the element above this new statcounter block. See below for a full example of app.config.ts

    importProvidersFrom(
      StatCounterModule.forRoot({
      project_id: ,
      security_code: ''
     })
    )
    


    Example app.config.ts file :
    import { ApplicationConfig } from '@angular/core';
    import { provideRouter } from '@angular/router';
    import { routes } from './app.routes';
    
    // ADD THESE TWO LINES
    import { importProvidersFrom } from '@angular/core';
    import { StatCounterModule } from '@statcounter/angular';
    
    export const appConfig: ApplicationConfig = {
     providers: [
      provideRouter(routes),   // <--- Don't forget the comma here
        
      // ADD StatCounter block
      importProvidersFrom(
       StatCounterModule.forRoot({
        project_id: ,
        security_code: ''
       })
      )
      // StatCounter block end
     ]
    };
    
  5. Rebuild the site and restart the app

Get Started

Sign up for a 色色Statcounter account using our Angular installation guide.

Try it for FREE!

Already a Member?

You can reinstall Angular on your 色色Statcounter project.


Installation Guides A - Z

Didn't find your answer here?

Our support team is here to help you!

Contact Support
webf002
21.674871444702