SRGSSR / srganalytics-apple

Covers analytics needs for SRG SSR products.
MIT License
0 stars 1 forks source link

Tracking enabled and user consent #66

Closed pyby closed 1 year ago

pyby commented 1 year ago

Issue type

Help / documentation

New feature

Description of the problem

The library provides analytics tool for SGRSSR applications. In Switzerland, new data projection rules are exposed to be available in September 2023.

The library has two SDKs:

TagCommander is a tagging tool, which mean that it can send data to other products.

SRF needs: https://jira.srg.beecollaboration.com/browse/SRFAPP-8414.

To be done in API

To be clarify

Environment information

pyby commented 1 year ago

If values have to be transmitted, two properties already exist: https://community.commandersact.com/tagcommander/getting-started/setup-guides/ios Tag Commander Apple SDK seems to have two default properties:

It can be changed at any time, and next hit will have the updated value:

[TCCoreVariables.sharedInstance addData:kTCPredefinedVariable_LimitUserTrackingEnabled withValue:@"YES"];
[TCCoreVariables.sharedInstance addData:kTCPredefinedVariable_isTrackingEnabled withValue:@"YES"];

Locally, the SDK could be deactivated.

[self.tagCommander deactivateSDK];
[self.tagCommander enableSDK];

Deactivated, the SDK does not send any hits. ⚠️Enable it again seems to not send hits again.

pyby commented 1 year ago

ComScore SDK has similar methods to deactivate it:

[comScoreConfiguration disable];

How to enable it again?

pyby commented 1 year ago

Documentations from Commander Act V5:

TCSerSide:

TCConsent: (not sure the project can use it)

In TCUser, properties:

On server side, the consent seems to be on the categories, to filter accepted consent or not.

pyby commented 1 year ago

Update after some investigations regarding Usercentrics and CommanderActs:

UC answers:

1. if we switch from 1 company to 5 or 6, will we be able to share custom services and their DPS across companies and keep same template ids?
Yes.

2. if we switch from 1 company to 5 or 6, will we be able to have same SRGSSR “validated” categories and their category Slug (which seem to be their ids)?
I don't know if I get your question right. Categories are not shared or held in sync – neither with 1 nor with 5 companies. Categories are unique per configuration. Do I miss something?

Like in apps code base (RSI, RTS, SRF and Play SRG), trusts only consent at services level and their unique template id.

In Commander Acts server v2: Destinations have consent categories filters, but after a try when sending Usercentrics categories slug in the TCUser category, nothing can be get server side. It seems that TrustCommander product is needed. SRG don't have this product in the contract.

Following those documentations: https://community.commandersact.com/tagcommander/getting-started/setup-guides/consent-management https://community.commandersact.com/tagcommander/user-manual/serverside/consents

The advice is to use a custom property (or many other), like consent_services or accepted_consent_services, string: template ids separated by comma. And use filter server side on Destinations.

pyby commented 1 year ago

Update after some investigations regarding Usercentrics and CommanderActs:

A public acceptedUserConsentServices array property added to collect template ids of accepted consents.

Option 1 in a page view payload:

"consent_services" : "service1,service3,sKiYj0vEg5bgqv"

Option 2 in a page view payload:

"user" : {
    "refused_vendors" : "ALL",
    "consent_categories" : [
      "service3",
      "sKiYj0vEg5bgqv",
      "service1"
    ]
}

page_view_srganalytics_apple_demo.txt

Previous test failed. Unable to save something in the "User consent category" server side. Now, it's possible tested with SRGAnalytics demo, it seems to work.

Filter on destination

ℹ️ TCUser.consentCategories only exist in the TagCommander V5 SDK. The screenshot is from server V2 (connected with TC V5 SDK). The custom property filter can be done on both versions (current or next one #62).

After some tests, one option should be selected and the other one, remove.

pyby commented 1 year ago

Requirement meetings done with SRF apps team, Pillarbox player team and Play SRG apps team. https://github.com/SRGSSR/pillarbox-documentation/issues/46

defagos commented 1 year ago

We have implemented a first API PoC on the feature/global-label-poc branch. Some remarks:

Integration in Play was easy, see feature/user-consent-global-label-poc branch.

The only thing that is missing is the ability to send empty strings in labels. According to the comScore SDK implementation guide, section 2.5.2, we may pass an empty screen when user consent is possible but not provided yet. Not sure this requires us to support empty strings but this is something we can discuss and then apply consistently in Pillarbox as well.

defagos commented 1 year ago

Based on these requirements and with the uncertainties which remain we implemented a flexible approach. We can now reliably provide global labels in SRG Analytics events, a mechanism which is well-suited for user consent transmission.

See #75 for the corresponding PR. This issue will not be linked directly since it has more requirements we could eventually fulfill in the future (e.g. a more expressive API for user consent management). Associated branches have been left open as well.

defagos commented 1 year ago

I guess that TCF might not have been considered for various reasons.

pyby commented 1 year ago

Done with https://github.com/SRGSSR/srganalytics-apple/pull/75 and library release 8.2.0.