Privacy
Privacy Management is a legacy module to manage Privacy and consent within Piano Analytics.
Started from PA SDK javascript 6.8, we've released a brand new "Consent Management" module to unify Privacy management and tagging methods across all Piano products.
If you already have a legacy Privacy Management implementation or a mobile implementation, it will still be compatible and continue to work.
Our Privacy methods allow you to control the data collected within the audience measurement solution, according to the different legislations to which you refer.
It offers you the possibility to adapt your tagging thanks to a precise management of the different measurement parameters (events and properties sent, trackers used, …), in the respect of the regulation in force.
We encourage you to first consult our Privacy Center in order to set up the appropriate tagging. Don't hesitate to involve your legal team and/or you DPO in the process.
Key notions
A Privacy Mode is a Privacy state where you can manage different options :
- The cookies (or storage for mobile) you want to set
- The events / properties you want to send
- The value your "visitor_privacy_mode" and "visitor_privacy_consent" properties will take
Basically, we can say that a Privacy Mode refers to a specific purpose.
Let's take another example:
We start in the same way as the schema above.
When a visitor lands to your page, you have not yet collected its consent. So you do not want to set cookies, and only collect anonymized data.
So you will use a specific Privacy Mode to achieve this behavior: no-consent
.
Then, when the visitor consents, you will want to start dropping a visitor cookie, and send all the information contained in your tagging.
To do this you will use another specific Privacy Mode: optin
.
Finally, the visitor could also have consented to a purpose other than opt-in. In that case, you can create a Privacy Mode that fits to your Privacy needs.
I can create an advertising
mode I will use to set Users cookies, and send some advertising information.
Thanks to the "visitor_privacy_mode" and "visitor_privacy_consent", you will be able to respect a perfect data governance by applying dedicated treatments depending on the mode the data has been collected.
Default Privacy Modes
Privacy Mode | "pa_vid" cookie | Visitor ID | visitor_privacy_mode | visitor_privacy_consent | Properties / events | Exclusion / Anonymization | Comment |
---|---|---|---|---|---|---|---|
optin | ✅ | GUID | optin | true | all | ❌ | |
exempt | ✅ | GUID | exempt | false | some | ❌ | Requires a specific configuration as explained in our Privacy center |
no-storage | ❌ | Finger Printing | no-storage | false | all | ❌ | |
no-consent | ❌ | ❌ | no-consent | false | some | ✅ | Based on a specic processing option you must request from our support center. All events will be excluded and anonymized. More information in our Privacy Center |
optout | ✅ | ❌ | optout | false | some | ✅ | All events will be excluded and anonymized. More information in our Privacy Center |
custom | you decide | you decide | you decide | you decide | you decide (same base as exempt mode) | ❌ | Some cookies, properties and events are included by default to a custom mode |
Each mode has by default its own rules.
You can check which storage keys (cookies), properties and events are included by default in the dedicated article.
You can also find the list of our cookies and storage keys in the Cookies & storage article.
If you want to use the ePrivacy exemption collection (or Hybrid measurement), please refer to our documentation.
Some legal steps are mandatory.
Set a Privacy Mode
You don't have to modify your event tagging depending on a specific consent.
The Privacy Mode will be in charge of sending the right information, depending on what you have configured.
It will be stored in a pa_privacy
cookie, and will be used on all events until it is modified, or until the cookie is deleted.
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.setMode(mode)
Parameters | Type | Description |
---|---|---|
mode | string | Privacy Mode |
pa.privacy.setMode("optin");
If you don't set any Privacy Mode (and none stored), the value set for configuration privacyDefaultMode
will be applied by default.
val privacyModesStorage = PianoAnalytics.getInstance().privacyModesStorage
privacyModesStorage.currentMode = PrivacyMode.OPTIN
Available values:
PrivacyMode.OPTIN
PrivacyMode.OPTOUT
PrivacyMode.EXEMPT
PrivacyMode.NO_CONSENT
PrivacyMode.NO_STORAGE
If you don't set any Privacy Mode (and none stored), the value set for configuration defaultPrivacyMode
will be applied by default.
Method:
func PianoAnalytics.privacySetMode(mode) -> void
Parameters | Type | Description |
---|---|---|
mode | String | Privacy Mode |
pa.privacySetMode("optin");
If you don't set any Privacy Mode (and none stored), the value set for configuration privacyDefaultMode
will be applied by default.
Method:
pa.privacySetMode(_ mode: String)
Parameters | Type | Description |
---|---|---|
mode | String | Privacy Mode |
pa.privacySetMode("optin");
If you don't set any Privacy Mode (and none stored), the value set for configuration privacyDefaultMode
will be applied by default.
Get a Privacy Mode
If you want to know the current mode used by the SDK, you can use the following method:
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.getMode()
pa.privacy.getMode(); // Return a string with the Privacy Mode value
val privacyModesStorage = PianoAnalytics.getInstance().privacyModesStorage
val currentPrivacyMode = privacyModesStorage.currentMode
Method:
func PianoAnalytics.privacyGetMode(PianoAnalytics.OnGetPrivacyModeListener) -> void
pa.privacyGetMode(privacyMode -> {
// do something with user
});
Method:
pa.privacyGetMode(completionHandler: ((_ privacyMode: String) -> Void)?)
pa.privacyGetMode { privacyMode in
print(privacyMode)
}
Manage a Privacy Mode
You can manage your Privacy Modes by controlling the storage, properties and events.
Storage
You can include one or more storage keys to your current Privacy Mode (in addition to those already included).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.include.storageKey(key[, modes])
Parameters | Type | Description |
---|---|---|
key | string | Privacy Mode |
modes | array | Privacy modes where you want to include the storage key (optional) |
pa.privacy.include.storageKey("pa_vid"); // Will be included in all modes
pa.privacy.include.storageKey("pa_uid", ["exempt", "customMode"]); // Will be included in selected modes
Method:
pa.privacy.include.storageKeys(keysArray[, modes])
Parameters | Type | Description |
---|---|---|
keysArray | array | Privacy Modes |
modes | array | Privacy modes where you want to include the storage key (optional) |
pa.privacy.include.storageKeys(["pa_vid", "pa_uid"]); // Will be included in all modes
pa.privacy.include.storageKeys(["pa_vid", "pa_uid"], ["exempt", "customMode"]); // Will be included in selected modes
PrivacyMode.EXEMPT.allowedStorageFeatures += PrivacyStorageFeature.VISITOR
Available values:
PrivacyStorageFeature.ALL
PrivacyStorageFeature.VISITOR
PrivacyStorageFeature.USER
PrivacyStorageFeature.PRIVACY
PrivacyStorageFeature.CRASH
PrivacyStorageFeature.LIFECYCLE
Method:
func PianoAnalytics.privacyIncludeStorageKey(storageKey) -> void
func PianoAnalytics.privacyIncludeStorageKey(storageKey, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
storageKey | PianoAnalytics.PrivacyStorageFeature | Privacy Mode |
privacyModes | String[] | Privacy modes where you want to include the storage key (optional) |
pa.privacyIncludeStorageKey(PianoAnalytics.PrivacyStorageFeature.USER); // Will be included in all modes
pa.privacyIncludeStorageKey(PianoAnalytics.PrivacyStorageFeature.USER, new String[]{"exempt"}); // Will be included in selected modes
Method:
func PianoAnalytics.privacyIncludeStorageKeys(storageKeys) -> void
func PianoAnalytics.privacyIncludeStorageKeys(storageKeys, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
storageKeys | PianoAnalytics.PrivacyStorageFeature[] | Privacy Modes |
privacyModes | String[] | Privacy modes where you want to include the storage key (optional) |
pa.privacyIncludeStorageKeys(new PianoAnalytics.PrivacyStorageFeature[]{PianoAnalytics.PrivacyStorageFeature.USER, PianoAnalytics.PrivacyStorageFeature.LIFECYCLE}); // Will be included in all modes
pa.privacyIncludeStorageKeys(new PianoAnalytics.PrivacyStorageFeature[]{PianoAnalytics.PrivacyStorageFeature.USER, PianoAnalytics.PrivacyStorageFeature.LIFECYCLE}, new String[]{"exempt"}); // Will be included in selected modes
Method:
pa.privacyIncludeStorageKey(_ storageKey: String, privacyModes: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
storageKey | String | Privacy Mode |
privacyModes | [String]? | Privacy modes where you want to include the storage key (optional) |
pa.privacyIncludeStorageKey(PA.Privacy.Storage.User); // Will be included in all modes
pa.privacyIncludeStorageKey(PA.Privacy.Storage.User, privacyModes: ["exempt"]); // Will be included in selected modes
Method:
pa.privacyIncludeStorageKeys(_ storageKeys: [String], privacyModes: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
storageKeys | [String] | Privacy Modes |
privacyModes | [String]? | Privacy modes where you want to include the storage key (optional) |
pa.privacyIncludeStorageKeys([PA.Privacy.Storage.User, PA.Privacy.Storage.Lifecycle]); // Will be included in all modes
pa.privacyIncludeStorageKeys([PA.Privacy.Storage.User, PA.Privacy.Storage.Lifecycle], privacyModes: ["exempt"]); // Will be included in selected modes
You can exclude one or more storage keys to your current Privacy Mode (in addition to those already exluded).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.exclude.storageKey(key[, modes])
Parameters | Type | Description |
---|---|---|
key | string | Privacy Mode |
modes | array | Privacy modes where you want to exclude the storage key (optional) |
pa.privacy.exclude.storageKey("pa_uid"); // Will be excluded in all modes
pa.privacy.exclude.storageKey("pa_uid", ["exempt", "customMode"]); // Will be excluded in selected modes
Method:
pa.privacy.exclude.storageKeys(keysArray[, modes])
Parameters | Type | Description |
---|---|---|
keysArray | array | Privacy Modes |
modes | array | Privacy modes where you want to exclude the storage key (optional) |
pa.privacy.exclude.storageKeys(["pa_vid", "pa_uid"]); // Will be excluded in all modes
pa.privacy.exclude.storageKeys(["pa_vid", "pa_uid"], ["exempt", "customMode"]); // Will be excluded in selected modes
PrivacyMode.EXEMPT.forbiddenStorageFeatures += PrivacyStorageFeature.VISITOR
Available values:
PrivacyStorageFeature.ALL
PrivacyStorageFeature.VISITOR
PrivacyStorageFeature.USER
PrivacyStorageFeature.PRIVACY
PrivacyStorageFeature.CRASH
PrivacyStorageFeature.LIFECYCLE
Method:
func PianoAnalytics.privacyExcludeStorageKey(storageKey) -> void
func PianoAnalytics.privacyExcludeStorageKey(storageKey, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
storageKey | PianoAnalytics.PrivacyStorageFeature | Privacy Mode |
privacyModes | String[] | Privacy modes where you want to exclude the storage key (optional) |
pa.privacyExcludeStorageKey(PianoAnalytics.PrivacyStorageFeature.USER); // Will be excluded in all modes
pa.privacyExcludeStorageKey(PianoAnalytics.PrivacyStorageFeature.USER, new String[]{"exempt"}); // Will be excluded in selected modes
Method:
func PianoAnalytics.privacyExcludeStorageKeys(storageKeys) -> void
func PianoAnalytics.privacyExcludeStorageKeys(storageKeys, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
storageKeys | PianoAnalytics.PrivacyStorageFeature[] | Privacy Modes |
privacyModes | String[] | Privacy modes where you want to exclude the storage key (optional) |
pa.privacyExcludeStorageKeys(new PianoAnalytics.PrivacyStorageFeature[]{PianoAnalytics.PrivacyStorageFeature.USER, PianoAnalytics.PrivacyStorageFeature.LIFECYCLE}); // Will be excluded in all modes
pa.privacyExcludeStorageKeys(new PianoAnalytics.PrivacyStorageFeature[]{PianoAnalytics.PrivacyStorageFeature.USER, PianoAnalytics.PrivacyStorageFeature.LIFECYCLE}, new String[]{"exempt"}); // Will be excluded in selected modes
Method:
pa.privacyExcludeStorageKey(_ storageKey: String, privacyModes: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
storageKey | String | Privacy Mode |
privacyModes | [String]? | Privacy modes where you want to exclude the storage key (optional) |
pa.privacyExcludeStorageKey(PA.Privacy.Storage.User); // Will be excluded in all modes
pa.privacyExcludeStorageKey(PA.Privacy.Storage.User, privacyModes: ["exempt"]); // Will be excluded in selected modes
Method:
pa.privacyExcludeStorageKeys(_ storageKeys: [String], privacyModes: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
storageKeys | [String] | Privacy Modes |
privacyModes | [String]? | Privacy modes where you want to exclude the storage key (optional) |
pa.privacyExcludeStorageKeys([PA.Privacy.Storage.User, PA.Privacy.Storage.Lifecycle]); // Will be excluded in all modes
pa.privacyExcludeStorageKeys([PA.Privacy.Storage.User, PA.Privacy.Storage.Lifecycle], privacyModes: ["exempt"]); // Will be excluded in selected modes
Properties
You can include one or more properties to the following events you will send for your current Privacy Mode (in addition to those already included).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.include.property(prop[, modes, events])
Parameters | Type | Description |
---|---|---|
prop | string | Property you want to include |
modes | array | Privacy Modes (optional) |
events | array | Events on which the properties will be included (optional) |
pa.privacy.include.property("article_category"); // Will be included in all modes
pa.privacy.include.property("article_category", ["exempt", "customMode"]); // Will be included in selected modes
pa.privacy.include.property("article_category", null, [
"page.display",
"click.*",
]); // Will be included for all modes, but only selected events
Method:
pa.privacy.include.properties(propsArray[, modes, events])
Parameters | Type | Description |
---|---|---|
propsArray | array | Properties you want to include |
modes | array | Privacy Modes (optional) |
events | array | Events on which the properties will be included (optional) |
pa.privacy.include.properties(["article_category", "article_date"]); // Will be included in all modes
pa.privacy.include.properties(
["article_category", "article_date"],
["exempt", "customMode"]
); // Will be included in selected modes
pa.privacy.include.properties(["article_category", "article_date"], null, [
"page.display",
"click.*",
]); // Will be included for all modes, but only selected events
PrivacyMode.EXEMPT.allowedPropertyKeys[Event.ANY]?.add(PropertyName("prop_name"))
Method:
func PianoAnalytics.privacyIncludeProperty(property) -> void
func PianoAnalytics.privacyIncludeProperty(property, privacyModes) -> void
func PianoAnalytics.privacyIncludeProperty(property, privacyModes, eventNames) -> void
Parameters | Type | Description |
---|---|---|
property | String | Property you want to include |
privacyModes | String[] | Privacy Modes (optional) |
eventNames | String[] | Events on which the properties will be included (optional) |
pa.privacyIncludeProperty("article_category"); // Will be included in all modes
pa.privacyIncludeProperty("article_category", new String[]{"exempt", "customMode"}); // Will be included in selected modes
pa.privacyIncludeProperty("article_category", null, new String[]{"page.display", "click.*"}); // Will be included for all modes, but only selected events
Method:
func PianoAnalytics.privacyIncludeProperties(properties) -> void
func PianoAnalytics.privacyIncludeProperties(properties, privacyModes) -> void
func PianoAnalytics.privacyIncludeProperties(properties, privacyModes, eventNames) -> void
Parameters | Type | Description |
---|---|---|
properties | String[] | Properties you want to include |
privacyModes | String[] | Privacy Modes (optional) |
eventNames | String[] | Events on which the properties will be included (optional) |
pa.privacyIncludeProperties(new String[]{"article_category", "article_date"}); // Will be included in all modes
pa.privacyIncludeProperties(new String[]{"article_category", "article_date"}, new String[]{"exempt", "customMode"}); // Will be included in selected modes
pa.privacyIncludeProperties(new String[]{"article_category", "article_date"}, null, new String[]{"page.display", "click.*"}); // Will be included for all modes, but only selected events
Method:
pa.privacyIncludeProperty(_ property: String, privacyModes: [String]? = ["*"], eventNames: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
property | String | Property you want to include |
privacyModes | [String]? | Privacy Modes (optional) |
eventNames | [String]? | Events on which the properties will be included (optional) |
pa.privacyIncludeProperty("article_category"); // Will be included in all modes
pa.privacyIncludeProperty("article_category", privacyModes: ["exempt", "customMode"]); // Will be included in selected modes
pa.privacyIncludeProperty("article_category", privacyModes: nil, eventNames: ["page.display", "click.*"]); // Will be included for all modes, but only selected events
Method:
pa.privacyIncludeProperties(_ properties: [String], privacyModes: [String]? = ["*"], eventNames: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
properties | [String] | Properties you want to include |
privacyModes | [String]? | Privacy Modes (optional) |
eventNames | [String]? | Events on which the properties will be included (optional) |
pa.privacyIncludeProperties(["article_category", "article_date"]); // Will be included in all modes
pa.privacyIncludeProperties(["article_category", "article_date"], privacyModes: ["exempt", "customMode"]); // Will be included in selected modes
pa.privacyIncludeProperties(["article_category", "article_date"], privacyModes: nil, eventNames: ["page.display", "click.*"]); // Will be included for all modes, but only selected events
You can exclude one or more properties to the following events you will send for your current Privacy Mode (in addition to those already exluded).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.exclude.property(prop[, modes, events])
Parameters | Type | Description |
---|---|---|
prop | string | Property you want to include |
modes | array | Privacy Modes (optional) |
events | array | Events on which the properties will be excluded (optional) |
pa.privacy.exclude.property("article_category"); // Will be excluded in all modes
pa.privacy.exclude.property("article_category", ["exempt", "customMode"]); // Will be excluded in selected modes
pa.privacy.exclude.property("article_category", null, [
"page.display",
"click.*",
]); // Will be excluded for all modes, but only selected events
Method:
pa.privacy.exclude.properties(propsArray[, modes, events])
Parameters | Type | Description |
---|---|---|
propsArray | array | Properties you want to exclude |
modes | array | Privacy Modes (optional) |
events | array | Events on which the properties will be excluded (optional) |
pa.privacy.exclude.properties(["article_category", "article_date"]); // Will be excluded in all modes
pa.privacy.exclude.properties(
["article_category", "article_date"],
["exempt", "customMode"]
); // Will be excluded in selected modes
pa.privacy.exclude.properties(["article_category", "article_date"], null, [
"page.display",
"click.*",
]); // Will be excluded for all modes, but only selected events
PrivacyMode.EXEMPT.forbiddenPropertyKeys[Event.ANY]?.add(PropertyName("prop_name"))
Method:
func PianoAnalytics.privacyExcludeProperty(property) -> void
func PianoAnalytics.privacyExcludeProperty(property, privacyModes) -> void
func PianoAnalytics.privacyExcludeProperty(property, privacyModes, eventNames) -> void
Parameters | Type | Description |
---|---|---|
property | String | Property you want to exclude |
privacyModes | String[] | Privacy Modes (optional) |
eventNames | String[] | Events on which the properties will be excluded (optional) |
pa.privacyExcludeProperty("article_category"); // Will be iecluded in all modes
pa.privacyExcludeProperty("article_category", new String[]{"exempt", "customMode"}); // Will be excluded in selected modes
pa.privacyExcludeProperty("article_category", null, new String[]{"page.display", "click.*"}); // Will be excluded for all modes, but only selected events
Method:
func PianoAnalytics.privacyExcludeProperties(properties) -> void
func PianoAnalytics.privacyExcludeProperties(properties, privacyModes) -> void
func PianoAnalytics.privacyExcludeProperties(properties, privacyModes, eventNames) -> void
Parameters | Type | Description |
---|---|---|
properties | String[] | Properties you want to exclude |
privacyModes | String[] | Privacy Modes (optional) |
eventNames | String[] | Events on which the properties will be excluded (optional) |
pa.privacyExcludeProperties(new String[]{"article_category", "article_date"}); // Will be excluded in all modes
pa.privacyExcludeProperties(new String[]{"article_category", "article_date"}, new String[]{"exempt", "customMode"}); // Will be excluded in selected modes
pa.privacyExcludeProperties(new String[]{"article_category", "article_date"}, null, new String[]{"page.display", "click.*"}); // Will be excluded for all modes, but only selected events
Method:
pa.privacyExcludeProperty(_ property: String, privacyModes: [String]? = ["*"], eventNames: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
property | String | Property you want to exclude |
privacyModes | [String]? | Privacy Modes (optional) |
eventNames | [String]? | Events on which the properties will be excluded (optional) |
pa.privacyExcludeProperty("article_category", privacyModes: ["exempt", "customMode"]); // Will be excluded in selected modes
pa.privacyExcludeProperty("article_category", privacyModes: nil, eventNames: ["page.display", "click.*"]); // Will be excluded for all modes, but only selected events
Method:
pa.privacyExcludeProperties(_ properties: [String], privacyModes: [String]? = ["*"], eventNames: [String]? = ["*"])
Parameters | Type | Description |
---|---|---|
properties | [String] | Properties you want to exclude |
privacyModes | [String]? | Privacy Modes (optional) |
eventNames | [String]? | Events on which the properties will be excluded (optional) |
pa.privacyExcludeProperties(["article_category", "article_date"]); // Will be iexcluded in all modes
pa.privacyExcludeProperties(["article_category", "article_date"], privacyModes: ["exempt", "customMode"]); // Will be excluded in selected modes
pa.privacyExcludeProperties(["article_category", "article_date"], privacyModes: nil, eventNames: ["page.display", "click.*"]); // Will be excluded for all modes, but only selected events
Events
You can include one or more events that can be sent for your current Privacy Mode (in addition to those already included).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.include.event(event[, modes])
Parameters | Type | Description |
---|---|---|
event | string | Event you want to include |
modes | array | Privacy Modes (optional) |
pa.privacy.include.event("selfpromotion.impression"); // Will be included in all modes
pa.privacy.include.event("selfpromotion.impression", ["exempt", "customMode"]); // Will be included in selected modes
Method:
pa.privacy.include.events(eventsArray[, modes])
Parameters | Type | Description |
---|---|---|
eventsArray | array | Events you want to include |
modes | array | Privacy Modes (optional) |
pa.privacy.include.events(["selfpromotion.display", "selfpromotion.click"]); // Will be included in all modes
pa.privacy.include.events(
["selfpromotion.display", "selfpromotion.click"],
["exempt", "customMode"]
); // Will be included in selected modes
PrivacyMode.EXEMPT.allowedEventNames += "selfpromotion.impression"
Method:
func PianoAnalytics.privacyIncludeEvent(eventName) -> void
func PianoAnalytics.privacyIncludeEvent(eventName, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
eventName | String | Event you want to include |
privacyModes | String[] | Privacy Modes (optional) |
pa.privacyIncludeEvent("selfpromotion.impression"); // Will be included in all modes
pa.privacyIncludeEvent("selfpromotion.impression", new String[]{"exempt", "customMode"}); // Will be included in selected modes
Method:
func PianoAnalytics.privacyIncludeEvents(eventNames) -> void
func PianoAnalytics.privacyIncludeEvents(eventNames, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
eventNames | String[] | Events you want to include |
privacyModes | String[] | Privacy Modes (optional) |
pa.privacyIncludeEvents(new String[]{"selfpromotion.impression", "selfpromotion.click"}); // Will be included in all modes
pa.privacyIncludeEvents(new String[]{"selfpromotion.impression", "selfpromotion.click"}, new String[]{"exempt", "customMode"}); // Will be included in selected modes
Method:
pa.privacyIncludeEvent(_ eventName: String, privacyModes: [String] = ["*"])
Parameters | Type | Description |
---|---|---|
eventName | String | Event you want to include |
privacyModes | [String] | Privacy Modes (optional) |
pa.privacyIncludeEvent("selfpromotion.impression"); // Will be included in all modes
pa.privacyIncludeEvent("selfpromotion.impression", privacyModes: ["exempt", "customMode"]); // Will be included in selected modes
Method:
pa.privacyIncludeEvents(_ eventNames: [String], privacyModes: [String] = ["*"])
Parameters | Type | Description |
---|---|---|
eventNames | [String] | Events you want to include |
privacyModes | [String] | Privacy Modes (optional) |
pa.privacyIncludeEvents(["selfpromotion.display","selfpromotion.click"]); // Will be included in all modes
pa.privacyIncludeEvents(["selfpromotion.display","selfpromotion.click"], privacyModes: ["exempt","customMode"]); // Will be included in selected modes
You can exclude one or more events that can be sent for your current Privacy Mode (in addition to those already excluded).
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.exclude.event(event[, modes])
Parameters | Type | Description |
---|---|---|
event | string | Event you want to include |
modes | array | Privacy Modes (optional) |
pa.privacy.exclude.event("selfpromotion.display"); // Will be excluded in all modes
pa.privacy.exclude.event("selfpromotion.display", ["exempt", "customMode"]); // Will be excluded in selected modes
Method:
pa.privacy.exclude.events(eventsArray[, modes, events])
Parameters | Type | Description |
---|---|---|
eventsArray | array | Event you want to exclude |
modes | array | Privacy Modes (optional) |
pa.privacy.exclude.events(["selfpromotion.display", "selfpromotion.click"]); // Will be excluded in all modes
pa.privacy.exclude.events(
["selfpromotion.display", "selfpromotion.click"],
["exempt", "customMode"]
); // Will be excluded in selected modes
PrivacyMode.EXEMPT.forbiddenEventNames += "selfpromotion.impression"
Method:
func PianoAnalytics.privacyExcludeEvent(eventName) -> void
func PianoAnalytics.privacyExcludeEvent(eventName, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
eventName | String | Event you want to exclude |
privacyModes | String[] | Privacy Modes (optional) |
pa.privacyExcludeEvent("selfpromotion.impression"); // Will be excluded in all modes
pa.privacyExcludeEvent("selfpromotion.impression", new String[]{"exempt", "customMode"}); // Will be excluded in selected modes
Method:
func PianoAnalytics.privacyExcludeEvents(eventNames) -> void
func PianoAnalytics.privacyExcludeEvents(eventNames, privacyModes) -> void
Parameters | Type | Description |
---|---|---|
eventNames | String[] | Events you want to exclude |
privacyModes | String[] | Privacy Modes (optional) |
pa.privacyExcludeEvents(new String[]{"selfpromotion.impression", "selfpromotion.click"}); // Will be excluded in all modes
pa.privacyExcludeEvents(new String[]{"selfpromotion.impression", "selfpromotion.click"}, new String[]{"exempt", "customMode"}); // Will be excluded in selected modes
Method:
pa.privacyExcludeEvent(_ eventName: String, privacyModes: [String] = ["*"])
Parameters | Type | Description |
---|---|---|
eventName | String | Event you want to exclude |
privacyModes | [String] | Privacy Modes (optional) |
pa.privacyExcludeEvent("selfpromotion.impression"); // Will be excluded in all modes
pa.privacyExcludeEvent("selfpromotion.impression", privacyModes: ["exempt", "customMode"]); // Will be excluded in selected modes
Method:
pa.privacyExcludeEvents(_ eventNames: [String], privacyModes: [String] = ["*"])
Parameters | Type | Description |
---|---|---|
eventNames | [String] | Events you want to exclude |
privacyModes | [String] | Privacy Modes (optional) |
pa.privacyExcludeEvents(["selfpromotion.display","selfpromotion.click"]); // Will be iexcluded in all modes
pa.privacyExcludeEvents(["selfpromotion.display","selfpromotion.click"], privacyModes: ["exempt","customMode"]); // Will be excluded in selected modes
Custom Privacy Modes
If our default Privacy Modes do not meet your expectations, you can create your own modes.
- Javascript
- Android (3.3.0+)
- Android
- Apple
Method:
pa.privacy.createMode(modeName, consentValue)
Parameters | Type | Description |
---|---|---|
modeName | string | Privacy Mode you will use in your tagging and that will be sent in the "visitor_privacy_mode" property |
consentValue | boolean | Privacy consent that will be sent in the "visitor_privacy_consent" property |
pa.privacy.createMode("customMode", true); // Create my mode
pa.privacy.include.properties(
["my_property", "my_second_property"],
"customMode"
); // Properties will be included in the mode I've created
// or
pa.privacy.include.property("*", "customMode"); // All properties will be included in the mode I've created
pa.privacy.setMode("customMode"); // Set my mode
// create new privacy mode
val myCustomPrivacyMode = PrivacyMode(
visitorMode = "name",
visitorConsent = true
)
// forbid all storage features for new mode
myCustomPrivacyMode.forbiddenStorageFeatures += PrivacyStorageFeature.ALL
// register the new privacy mode
privacyModesStorage.allModes += myCustomPrivacyMode
// set current privacy mode (should be registered before, if custom)
privacyModesStorage.currentMode = myCustomPrivacyMode
Method:
func PianoAnalytics.privacyCreateMode(mode, visitorConsent)
Parameters | Type | Description |
---|---|---|
mode | String | Privacy Mode you will use in your tagging and that will be sent in the visitor_privacy_mode property |
visitorConsent | Boolean | Privacy consent that will be sent in the visitor_privacy_consent property |
pa.privacyCreateMode("customMode", true); // Create my mode
pa.privacyIncludeProperties(new String[]{"my_property", "my_second_property"}, new String[]{"customMode"}); // Properties will be included in the mode I've created
// or
pa.privacyIncludeProperty("*", new String[]{"customMode"}); // All properties will be included in the mode I've created
pa.privacySetMode("customMode"); // Set my mode
Method:
pa.privacyCreateMode(_ mode: String, visitorConsent: Bool)
Parameters | Type | Description |
---|---|---|
mode | String | Privacy Mode you will use in your tagging and that will be sent in the visitor_privacy_mode property |
visitorConsent | Bool | Privacy consent that will be sent in the visitor_privacy_consent property |
pa.privacyCreateMode("customMode", visitorConsent: true) // Create my mode
pa.privacyIncludeProperties(["my_property", "my_second_property"], privacyModes: ["customMode"]) // Properties will be included in the mode I've created
// or
pa.privacyIncludeProperty("*", privacyModes: ["customMode"]) // All properties will be included in the mode I've created
pa.privacySetMode("customMode") // Set my mode
visitor_privacy_consent
can be used in Explorer or Data Query if you want to filter on users that have given consent or not.
We also use it in Data Flow to filter your stream, and Stream Inspector to filter your sessions.