setSessionHash

The setSessionHash() method controls the sh parameter sent with tracking events.

The SDK saves this setting and keeps it between app launches. The default value is SessionHash.disabled.

Syntax

await FlutterPiwikPro.sharedInstance.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.notSet — The sh parameter isn't. The processing service uses the value from the Privacy in the global or app settings.

Examples

To enable the session hash:

await FlutterPiwikPro.sharedInstance.setSessionHash(SessionHash.enabled);

Related methods