Skip to content

Instantly share code, notes, and snippets.

@andresilveirah
Last active January 5, 2021 17:25
Show Gist options
  • Save andresilveirah/202c5b371a012836f97a4a9460ae72d4 to your computer and use it in GitHub Desktop.
Save andresilveirah/202c5b371a012836f97a4a9460ae72d4 to your computer and use it in GitHub Desktop.

Unified Wrapper

The majority of (if not all) our clients, when integrating with our SDKs, have pointed out the integration is really cumbersome when covering both GDPR and CCPA. We also pay a high price in terms of development to maintain two repositories in sync (x2 platforms, iOS and Android).

In oder to solve this problem we're merging the two SDKs into one meaning the SDKs will no longer "know" if they are dealing with CCPA or GDPR only. Instead, they will deal with all legislations at the same time.

POST message-url?inApp=true&native=true|false

Also known as "get", this endpoint will receive the account/property/campaign info as well as meta and uuid for all legislations (gdpr/ccpa).

Request

{
    "requestUUID": String,
    "authId": String?,
    "accountId": Number,
    "multiCampaign": Boolean, // when false, indicates a single property is used for multiple legislations
    "legislations": {
        "gdpr?": {
          "propertyHref": String,
          "propertyId": Number,
          "targetingParams": Object,
          "campaignEnv": "prod" | "stage",
          "uuid": String?,
          "meta": String?
        },
        "ccpa?": {
          "propertyHref": String,
          "propertyId": Number,
          "targetingParams": Object,
          "campaignEnv": "prod" | "stage",
          "uuid": String?,
          "meta": String?
        }
    }
}

Response

{
    "message": {
      "legislation": "GDPR" | "CCPA",
      "url": String?, // the response will contain either url *or* msgJson based on a query param passed in the request
      "msgJSON": Message?
    },
    "gdpr": {
        "applies": Boolean,
        "uuid": String,
        "userConsent": GDPRUserConsent,
        "meta": String
    },
    "ccpa": {
        "applies": Boolean,
        "uuid": String,
        "userConsent": CCPAUserConsent,
        "meta": String
    }
}

Remarks

What is the multiCampaign flag?

Support to each legislation will depend on the keys present inside the campaigns attribute. If multiple legislations are included in the campaigns section then the multiCampaign flag will be looked at.

// when false, indicates a single property is used for multiple legislations

What happens if the publisher doesn't want to support any of the legislations?

If one the publisher wishes to "skip" a legislation (intentionally not supporting it), the dev need to avoid filling in the property details for that legislation and leave multiCampaign set to false.

What happens when, in the future, there's a new legislation being introduced?

Legislation keys are not required to be sent. Problem: if one new legislation key is not sent (older SDKs) but the dev at the time chose multiCampaign: true, that'll indicate to the wrapper the first campaign should be used for all current legislations.

"applies": Boolean -> can a "gdpr" message being returned without GDPR applies?

Possibly.

POST /consent

Also known as "post", will work exactly as they work today. In fact, we'll reuse the same endpoints since, at the time of the post, the SDK will know which legistlation the user is consenting to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment