@daffodil/analytics
Advanced tools
Comparing version 0.75.0 to 0.76.0
@@ -1,1 +0,1 @@ | ||
{"name":"@daffodil/analytics","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/analytics"]}}},"version":"0.75.0","description":"General package for piping ngrx actions into provided external analytics services.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"peerDependencies":{"@angular/common":"^17.0.0","@angular/core":"^17.0.0","rxjs":"7.8.1","@ngrx/store":"^17.0.0","@ngrx/effects":"^17.0.0"},"module":"fesm2022/daffodil-analytics.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-analytics.mjs","esm":"./esm2022/daffodil-analytics.mjs","default":"./fesm2022/daffodil-analytics.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}} | ||
{"name":"@daffodil/analytics","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/analytics"]}}},"version":"0.76.0","description":"General package for piping ngrx actions into provided external analytics services.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"peerDependencies":{"@angular/common":"^17.0.0","@angular/core":"^17.0.0","rxjs":"7.8.1","@ngrx/store":"^17.0.0","@ngrx/effects":"^17.0.0"},"module":"fesm2022/daffodil-analytics.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/daffodil-analytics.mjs","esm":"./esm2022/daffodil-analytics.mjs","default":"./fesm2022/daffodil-analytics.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.3.0"}} |
# @daffodil/analytics | ||
`@daffodil/analytics` is a lightweight Angular package that helps integrate analytics providers into your Angular applications, supporting multiple analytics services. | ||
## Overview | ||
It simplifies event tracking and provides configuration options, such as defining analyzable actions. Notably, `@daffodil/analytics` focuses on handling state-related events and operates specifically on [`Actions`](https://ngrx.io/api/store/Action) from [`@ngrx/store`](https://ngrx.io/guide/store), rather than browser events. Additionally, it includes testing utilities tailored for analytics event tracking in Angular applications. | ||
The Daffodil Analytics Module is a lightweight Angular package that helps integrate analytics providers into your Angular applications, supporting multiple analytics services. It simplifies event tracking and provides configuration options, such as defining analyzable actions. Notably, this module focuses on handling state-related events and operates specifically on [`Actions`](https://ngrx.io/api/store/Action) from [`@ngrx/store`](https://ngrx.io/guide/store), rather than browser events. Additionally, the package includes testing utilities tailored for analytics event tracking in Angular applications. | ||
## Installation | ||
To install `@daffodil/analytics`, use the following commands in your terminal. | ||
## Features | ||
- ["Opt-in" action tracking](/libs/analytics/guides/configuration.md#configuring-analyzeableactions) | ||
Install with npm: | ||
```bash | ||
npm install @daffodil/auth --save | ||
``` | ||
## Usage | ||
Install with yarn: | ||
In this example, `MyAnalyticsService` implements the [`DaffAnalyticsTrackerClass`](/libs/analytics/DaffAnalyticsTrackerClass.ts) interface, providing a track method. Inside the track method, you can define your custom logic for tracking analytics events based on the provided action. The service returns an observable, indicating the success of the tracking operation. Replace the logic inside the track method with your actual analytics tracking implementation. | ||
### Define a tracking service | ||
```ts | ||
import { Injectable } from '@angular/core'; | ||
import { DaffAnalyticsTrackerClass } from '@daffodil/analytics'; | ||
import { Action } from '@ngrx/store'; | ||
import { Observable, of } from 'rxjs'; | ||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class MyAnalyticsService implements DaffAnalyticsTrackerClass { | ||
track(action: Action): Observable<unknown> { | ||
// Your custom logic for tracking analytics events based on the provided action | ||
// Return an observable, for example, indicating whether the tracking was successful | ||
return of(true); | ||
} | ||
} | ||
```bash | ||
yarn add @daffodil/auth | ||
``` | ||
### Import DaffAnalyticsModule in Your Application | ||
```ts | ||
import { DaffAnalyticsModule } from '@daffodil/analytics'; | ||
// Import your custom analytics service(s) | ||
import { MyAnalyticsService } from './path/to/my-analytics.service'; | ||
@NgModule({ | ||
imports: [ | ||
// Initialize Daffodil Analytics Module with custom analytics service(s) | ||
DaffAnalyticsModule.forRoot([MyAnalyticsService]), | ||
// ... other modules | ||
], | ||
// ... other module metadata | ||
}) | ||
export class YourAppModule { } | ||
``` | ||
## Features | ||
- ["Opt-in" action tracking](/libs/analytics/guides/configuration.md#configuring-analyzeableactions) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36989
23