userEmail

❗️

Deprecated

Audience Manager is no longer available in the latest product version. The notes below describe legacy behaviour for apps that still integrate Audience Manager.

The userEmail property stores the signed-in user’s email on the tracker. In the iOS SDK this value is only added to Audience Manager requests (for example when calling sendAudienceManagerAttribute) when isAnonymizationEnabled is false. It is not automatically attached to ordinary Analytics tracking (for example screen views).

Syntax

PiwikTracker.sharedInstance()?.userEmail = "userEmail"
[PiwikTracker sharedInstance].userEmail = @"userEmail";

Parameters

  • userEmail string, optional - The user's email address. Set to nil after sign-out if you no longer want it stored on the tracker.

Examples

Set the email after sign-in (typical). Use it together with Audience Manager calls if your app still uses that module, for example sendAudienceManagerAttribute.

PiwikTracker.sharedInstance()?.userEmail = "[email protected]"
[PiwikTracker sharedInstance].userEmail = @"[email protected]";

Notes

  • Prefer setting userEmail (and userID) right after the tracker is started so early events are attributed consistently (PiwikTracker header guidance).
  • For Audience Manager profile calls on iOS, the email is not included when isAnonymizationEnabled is true.
  • In Audience Manager Profiles, the email may be visible depending on your setup and permissions.

Related methods