setSessionHash

The setSessionHash() method controls the sh parameter sent with tracking events. The SDK saves this setting between app launches. The default value is DISABLED.

Syntax

import { SessionHash } from '@piwikpro/react-native-piwik-pro-sdk';

await PiwikProSdk.setSessionHash(sessionHash);

Parameters

sessionHash (SessionHash, required)

The session hash mode. Available values:

  • SessionHash.ENABLED — The sh parameter is set to 1.
  • SessionHash.DISABLED — The sh parameter is set to 0 (default).
  • SessionHash.NOT_SET — The sh parameter isn't sent. The processing service uses the value from the Privacy tab in global or app settings.

Examples

To enable the session hash:

import { SessionHash } from '@piwikpro/react-native-piwik-pro-sdk';

await PiwikProSdk.setSessionHash(SessionHash.ENABLED);

Related methods