Configuration

You can configure the way that @daffodil/analytics works by providing configurations to the DaffAnalyticsModule.

Configuring analyzeableActions

By default, @daffodil/analytics doesn't track any events to encourage explicit tracking. For instance, you might want to exclude tracking the event for converting payment card data into a token or "login" actions to avoid logging sensitive information.

import { DaffAnalyticsModule } from '@daffodil/analytics';

@NgModule({
  imports: [
    DaffAnalyticsModule.forRoot(
      [],
      { analyzeableActions: ['ActionA', 'ActionB'] }
    ),
  ],
})
export class YourAppModule { }

This configuration specifically tracks events with the payloads 'ActionA' and 'ActionB', excluding all others. Any defined DaffAnalyticsTracker will receive a copy of these events for potential transmission to an external analytics provider.

See the DaffAnalyticsConfigInterface for more details.

Graycore, LLC © 2018 - 2024. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.