From f6170c7f860258b3049c9210e096d6dc10a2c4c5 Mon Sep 17 00:00:00 2001
From: tom-win87 <76440079+tom-win87@users.noreply.github.com>
Date: Tue, 21 May 2024 14:06:29 -0400
Subject: [PATCH] [HCD 523] campaign type comments
---
README.md | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/README.md b/README.md
index 9309bad39..826a34063 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ class ViewController: UIViewController {
}
@IBAction func onCCPAPrivacyManagerTap(_ sender: Any) {
- consentManager.loadCCPAPrivacyManager(withId: "14967")
+ consentManager.loadUSNATPrivacyManager(withId: "14967")
}
lazy var consentManager: SPSDK = { SPConsentManager(
@@ -96,9 +96,10 @@ class ViewController: UIViewController {
propertyId: 16893,
propertyName: try! SPPropertyName("mobile.multicampaign.demo"),
campaigns: SPCampaigns(
- gdpr: SPCampaign(),
- usnat: SPCampaign(),
- ios14: SPCampaign()
+ gdpr: SPCampaign(), //only include if this campaign type is enabled in the Sourcepoint portal
+ usnat: SPCampaign(), //only include if this campaign type is enabled in the Sourcepoint portal
+ ccpa: SPCampaign(), //only include if this campaign type is enabled in the Sourcepoint portal
+ ios14: SPCampaign() //only include if this campaign type is enabled in the Sourcepoint portal
),
delegate: self
)}()
@@ -163,9 +164,10 @@ extension ViewController: SPDelegate {
SPCampaign *campaign = [[SPCampaign alloc] initWithTargetingParams: [NSDictionary dictionary]];
SPCampaigns *campaigns = [[SPCampaigns alloc]
- initWithGdpr: campaign
- usnat: campaign
- ios14: campaign
+ initWithGdpr: campaign //only include if this campaign type is enabled in the Sourcepoint portal
+ usnat: campaign //only include if this campaign type is enabled in the Sourcepoint portal
+ ccpa: campaign //only include if this campaign type is enabled in the Sourcepoint portal
+ ios14: campaign //only include if this campaign type is enabled in the Sourcepoint portal
environment: SPCampaignEnvPublic];
consentManager = [[SPConsentManager alloc]
@@ -377,6 +379,7 @@ Add the following keys to your app's `info.plist` to define the initial consent
Use Google's `setConsent` method to update the relevant consent checks when the appropriate purposes are consented to/rejected.
> The consent checks updated via the `setConsent` method will vary and depends on how you are implementing Google Consent Mode 2.0 on your mobile property within the Sourcepoint portal. The method should only be called with consent checks that are mapped within your vendor list to custom purposes.
Review Sourcepoint's implementation documentation below for more information:
+>
> - [Implement Google Consent Mode 2.0 on GDPR TCF (mobile)](https://docs.sourcepoint.com/hc/en-us/articles/26139951882643-Google-Consent-Mode-2-0-GDPR-TCF-mobile#h_01HPHHGSP42A36607MDC7NVBV9)
> - [Implement Google Consent Mode 2.0 on GDPR Standard (mobile)](https://docs.sourcepoint.com/hc/en-us/articles/26159382698387-Google-Consent-Mode-2-0-GDPR-Standard-mobile#h_01HPJ2MT0F5B1G8ZZVD5PNXT9S)
@@ -412,14 +415,14 @@ The vendor grants will be re-generated, this time taking into consideration the
Using the same strategy for the custom consent, it's possible to programmatically delete the current user consent to a list of vendors, categories and legitimate interest categories by using the following method:
- ```swift
+```swift
func deleteCustomConsentGDPR(
- vendors: [String],
- categories: [String],
- legIntCategories: [String],
- handler: @escaping (SPGDPRConsent) -> Void
- )
- ```
+ vendors: [String],
+ categories: [String],
+ legIntCategories: [String],
+ handler: @escaping (SPGDPRConsent) -> Void
+)
+```
The method is asynchronous so you must pass a completion handler that will receive back an instance of SPGDPRConsent in case of success or it'll call the delegate method onError in case of failure.
@@ -465,6 +468,7 @@ if let userConsents = userConsents {
webview.load(URLRequest(URL(string: "https://my-url.com/")!)) // load url without _sp_pass_consent=true
}
```
+
Note: The desitination url needs to implement the unified script.
A few remarks:
@@ -474,6 +478,7 @@ A few remarks:
3. Your web content needs to be loaded (or loading) on the webview and our [web SDK](https://docs.sourcepoint.com/hc/en-us/articles/8073421891091-GDPR-TCF-and-U-S-Privacy-CCPA-implementation-guide-web-) should be included in it. Furthermore, you need to add the query param `_sp_pass_consent=true` to your URL, this will signal to Sourcepoint's web SDK it needs to wait for the consent data to be injected from the native code, instead of immediately querying it from our servers.
## Overwriting default language
+
By default, the SDK will instruct the message to render itself using the locale defined by the `WKWebView`. If you wish to overwrite this behavior and force a message to be displayed in a certain language, you need to set the `.messageLanguage` attribute of the `SPConsentManager` _before_ calling `.loadMessage() / .loadPrivacyManager()`.
```swift
@@ -518,7 +523,7 @@ SPCampaign *myCampaign = [[SPCampaign alloc]
When migrating a property from the U.S. Privacy (Legacy) campaign to U.S. Multi-State Privacy campaign, the SDK will automatically detect previously set end-user opt-in/opt-out preferences for U.S. Privacy (Legacy) and have that transferred over to U.S. Multi-State Privacy.
-> If an end-user rejected a vendor or category for U.S. Privacy, Sourcepoint will set the *Sharing of Personal Information Targeted Advertisting* and *Sale of Personal Information* privacy choices or the *Sale or Share of Personal Information/Targeted Advertising* privacy choice (depending on your configuration) to **opted-out** when the preferences are transferred.
+> If an end-user rejected a vendor or category for U.S. Privacy, Sourcepoint will set the _Sharing of Personal Information Targeted Advertisting_ and _Sale of Personal Information_ privacy choices or the _Sale or Share of Personal Information/Targeted Advertising_ privacy choice (depending on your configuration) to **opted-out** when the preferences are transferred.
If you ever used authenticated consent for CCPA, you'll have to set the flag `transitionCCPAAuth` manually when configuring the campaigns to be loaded by the SDK. This way, the SDK will look for authenticated consent within CCPA profiles and carry that over to USNat, even if the user currently doesn't have CCPA local data (on a fresh install, for example).
@@ -531,6 +536,7 @@ var consentManager = SPConsentManager(
delegate: self
)
```
+
## Check end-user consent status for U.S. Multi-State Privacy
Your organization can check an end-user's consent status for a privacy choice by checking the `statuses` object for `usnat` in `SPUserData`.
@@ -558,11 +564,13 @@ if SPUserData.usnat?.consents?.statuses.{status} {
If you're transitioning from U.S. Privacy (Legacy) to U.S. Multi-State Privacy, you may want to continue supporting the legacy US privacy string (`IABUSPrivacy_String`).
-> Since U.S. Privacy (Legacy) does not have support for sensitive data categories, any organization who require sensitive data opt-ins should not use this approach. Additionally, this approach should not be used by organizations who ***only*** require Sharing of Personal Information/Targeted Advertising. A `uspString` will only be set if you use either of the following privacy choices:
+> Since U.S. Privacy (Legacy) does not have support for sensitive data categories, any organization who require sensitive data opt-ins should not use this approach. Additionally, this approach should not be used by organizations who **_only_** require Sharing of Personal Information/Targeted Advertising. A `uspString` will only be set if you use either of the following privacy choices:
+>
> - Sale of Personal Information
> - Sale or Sharing of Personal Information/Targeted Advertising
To do so, when instantiating the SDK, make sure to set the flag `.supportLegacyUSPString` to true. Example:
+
```swift
var consentManager = SPConsentManager(
...
@@ -622,7 +630,7 @@ The action: `SPAction` parameter, among other data (used internally), contains:
| Attribute | Description |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type: SPActionType` | Indicates the type of action, this is an enumerated value. For example, a response to the ATT message is `RequestATTAccess` or to show the privacy manager is `ShowPrivacyManager`. |
-| `campaignType: SPCampaignType` | Indicates the type of campaign in which the action was taken. This is an enumerated value e.g. **gdpr, ios14, ccpa, usnat, unknown**. |
+| `campaignType: SPCampaignType` | Indicates the type of campaign in which the action was taken. This is an enumerated value e.g. **gdpr, ios14, ccpa, usnat, unknown**. |
| `customActionId: String` | If the type of action is Custom, this attribute will contain the id you assigned to it when building the message in our message builder (publisher's portal). |
| `consentLanguage` | The language used in the messages. |
| `publisherData: [String: String]` | This is an arbitrary dictionary of [String: String] containing data the publisher wishes to send to our servers so it can be retrieved via API later on. The publisher needs to set this field during the callback if they need the data to be sent to our server. |