getUserAgent

The getUserAgent() method returns the default user agent string used by the SDK. This is useful for cross-platform data collection when your app uses a WebView. You can set the same user agent in the WebView to recognize the same visitor across native and web content.

Syntax

const userAgent = await PiwikProSdk.getUserAgent();

Returns

The default user agent string used by the SDK.

Type: string

Examples

To read the user agent string:

const userAgent = await PiwikProSdk.getUserAgent();