npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@renet-consulting/ngx-tracking-analytics

v17.0.0

Published

This library has an implementation of tracking-analytics.

Downloads

24

Readme

Tracking-Analytics

NPM version NPM downloads MIT license

The application is custom implementation Google Analytics to handle a behavior of a user. It's only the front-end part of the tracking user's data, see the back-end part on the TODO-add a link.

Installation

npm install @renet-consulting/ngx-tracking-analytics --save

Include it in your application

  1. Add NgxTrackerModule to your root NgModule passing an config with a loader TrackerHttpService
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, Routes } from '@angular/router';

import { NgxTrackerModule } from '@renet-consulting/ngx-tracking-analytics';

const ROUTES: Routes = [
    { path: '', component: HomeComponent },
    { path: 'about', component: AboutComponent }
];

export function trackerHttpServiceFactory(trackerService: NgxTrackerService, http: HttpClient): TrackerHttpService {
    return new TrackerHttpService(trackerService, http);
}

@NgModule({
    imports: [
        BrowserModule,
        RouterModule.forRoot(ROUTES),

        // added to imports
        NgxTrackerModule.forRoot({
			loader: { provide: NgxTrackerHttpService, useFactory: (trackerHttpServiceFactory), deps: [NgxTrackerService, HttpClient] },
			baseUrl: { provide: NGX_BASE_URL, useValue: window.location.host },
		}),
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
})
  1. Where the TrackerHttpService is:
@Injectable()
export class TrackerHttpService {

    public readonly keyId: string = "Encrypt-Key";
    public readonly ivId: string = "Encrypt-Iv";

    constructor(
        private trackerService: NgxTrackerService,
        private http: HttpClient,
    ) { }

    public addTracker = (item: TrackerModel): Observable<any> => {
        const keyId: string = this.trackerService.randomValue;
        const ivId: string = this.trackerService.randomValue;
        const value: string = this.trackerService.encrypt(item, keyId, ivId);
        return this.http
            .get(`api/ra?model=${value}`, {
                responseType: "text",
                headers: new HttpHeaders({
                    [this.keyId]: keyId,
                    [this.ivId]: ivId
                })
            });
    }
}

Usage

Collect basic data

import { Component } from "@angular/core";

@Component({
    selector: "app",
    template: `
	<router-outlet></router-outlet>
	<ngx-tracker></ngx-tracker>
	`
})
export class AppComponent {
    
	constructor() { }
}

Release v17.0.0

  • Converted project to Angular v17

Release v16.0.0

  • Converted project to Angular v16

Release v15.0.0

  • Converted project to Angular v15
  • Updated crypto-js to v4.2.0
  • Updated @types/crypto-js to v4.2.2

Release v14.0.3

Upgrade version to 2 and change t>en

Release v14.0.1

Upgrade "rxjs" to "~6.6.7"

Release v14.0.0

Converted project to Angular v14

Release v9.0.0

Converted project to Angular v9