Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for First Party Data #186

Merged
merged 34 commits into from
Jul 31, 2019

Conversation

yoalex5
Copy link
Collaborator

@yoalex5 yoalex5 commented May 1, 2019

GitHub issue #181

//ACL block

  1. Access Control List

Targeting API:

func addBidderToAccessControlList(_ bidderName: String)
func removeBidderFromAccessControlList(_ bidderName: String)
func clearAccessControlList()

Example

Swift:

Targeting.shared.addBidderToAccessControlList(Prebid.bidderNameRubiconProject)

Objective-C:

[Targeting.shared addBidderToAccessControlList: Prebid.bidderNameRubiconProject];

OpenRTB request:

"ext": {
	"prebid": {
		"data": {
			"bidders": [
				"rubicon"]
		}
	}
}

//data block
2. global user data

Targeting API:

func addUserData(key: String, value: String)
func updateUserData(key: String, value: Set<String>) 
func removeUserData(forKey: String)
func clearUserData()

Example

Swift:

Targeting.shared.addUserData(key: "globalUserDataKey1", value: "globalUserDataValue1")

Objective-C:

[Targeting.shared addUserDataWithKey:@"globalUserDataKey1" value:@"globalUserDataValue1"];

OpenRTB request:

"user": {
	"ext": {
		"data": {
			"globalUserDataKey1": [
				"globalUserDataValue1"]
		}
	}
}
  1. global context data

Targeting API:

func addContextData(key: String, value: String)
func updateContextData(key: String, value: Set<String>)
func removeContextData(forKey: String)
func clearContextData()

Example

Swift:

Targeting.shared.addContextData(key: "globalContextDataKey1", value: "globalContextDataValue1")

Objective-C:

[Targeting.shared addContextDataWithKey:@"globalContextDataKey1" value:@"globalContextDataValue1"];

OpenRTB request:

"app": {
	"ext": {
		"data": {
			"globalContextDataKey1": [
				"globalContextDataValue1"]
		}
	}
}
  1. adunit context data

AdUnit API:

func addContextData(key: String, value: String)
func updateContextData(key: String, value: Set<String>)
func removeContextData(forKey: String)
func clearContextData()

Example

Swift:

adUnit.addContextData(key: "adunitContextDataKey1", value: "adunitContextDataValue1")

Objective-C:

[self.adUnit addContextDataWithKey:@"adunitContextDataKey1" value:@"adunitContextDataValue1"];

OpenRTB request:

"imp": [{
	"ext": {
		"context": {
			"data": {
				"adunitContextDataKey1": [
					"adunitContextDataValue1"]
			}
		}
	}
}]
  1. global context keywords

Targeting API:

func addContextKeyword(_ newElement: String)
func addContextKeywords(_ newElements: Set<String>)
func removeContextKeyword(_ element: String)
func clearContextKeywords() 

Example

Swift:

Targeting.shared.addContextKeyword("globalContextKeywordValue1")
Targeting.shared.addContextKeyword("globalContextKeywordValue2")
Targeting.shared.addContextKeyword("globalContextKeywordValue3")

Objective-C:

[Targeting.shared addContextKeyword:@"globalContextKeywordValue1"];
[Targeting.shared addContextKeyword:@"globalContextKeywordValue2"];
[Targeting.shared addContextKeyword:@"globalContextKeywordValue3"];

OpenRTB request:

"app": {
    "keywords": "globalContextKeywordValue1,globalContextKeywordValue2,globalContextKeywordValue3"
}
  1. global user keywords

Targeting API:

func addUserKeyword(_ newElement: String)
func addUserKeywords(_ newElements: Set<String>)
func removeUserKeyword(_ element: String)
func clearUserKeywords()

Example

Swift:

Targeting.shared.addUserKeyword("globalUserKeywordValue1")
Targeting.shared.addUserKeyword("globalUserKeywordValue2")
Targeting.shared.addUserKeyword("globalUserKeywordValue3")

Objective-C:

[Targeting.shared addUserKeyword:@"globalUserKeywordValue1"];
[Targeting.shared addUserKeyword:@"globalUserKeywordValue2"];
[Targeting.shared addUserKeyword:@"globalUserKeywordValue3"];

OpenRTB request:

"user": {
    "keywords": "globalUserKeywordValue1,globalUserKeywordValue2,globalUserKeywordValue3"
}
  1. adunit context keywords

AdUnit API:

func addContextKeyword(_ newElement: String)
func addContextKeywords(_ newElements: Set<String>)
func removeContextKeyword(_ element: String)
func clearContextKeywords()

Example

Swift:

adUnit.addContextKeyword("adunitContextKeywordValue1")
adUnit.addContextKeyword("adunitContextKeywordValue2")
adUnit.addContextKeyword("adunitContextKeywordValue3")

Objective-C:

[self.adUnit addContextKeyword:@"adunitContextKeywordValue1"];
[self.adUnit addContextKeyword:@"adunitContextKeywordValue2"];
[self.adUnit addContextKeyword:@"adunitContextKeywordValue3"];

OpenRTB request:

"imp": [{
    "ext": {
        "context": {
            "keywords": "adunitContextKeywordValue1,adunitContextKeywordValue2,adunitContextKeywordValue3"
        }
    }
}]

Deprecated API
AdUnit. userKeywords was marked as deprecated, because this parameter creates user.keywords object.
Since global user keywords API has been added in this PR and it brings the functionality to work with userKeywords on global level hence I have added a compatibility function to create user.keywords object.
The logic is: if globalUserKeywords is not empty use this one, else use adunitUserKeywords

all_changes_are_included_2.chls.zip

yoalex5 added 29 commits April 1, 2019 13:13
- default PB request timeout value was moved to PB_Request_Timeout constant
- initializing loadSuccesfulException was moved on the beginning because it is possible when fulfill method is called before
- minor changes and fixes
-adUnit customKeywords methods were marked as deprecated
-added compatibility between adUnit.userKeywords and new global.userKeywords
@yoalex5
Copy link
Collaborator Author

yoalex5 commented May 6, 2019

@ppuviarasu Have you had a chance to review this feature ?

@bszekely1 bszekely1 requested a review from ppuviarasu June 27, 2019 16:17
@bszekely1 bszekely1 added this to the Prebid SDK 1.2 milestone Jul 24, 2019
Copy link
Collaborator

@ppuviarasu ppuviarasu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this PR is for 1st party data… But i see changes made in PBMViewTool.swift. This has no relevance to the feature specified. PBMViewTool.swift changes are big & can be separated out as a separate enhancement PR. Please do not mix a feature PR with enhancement changes.

@ppuviarasu
Copy link
Collaborator

Also this PR has merge conflicts. do resolve the same and request for review

yoalex5 added 2 commits July 29, 2019 16:52
…ty_data

# Conflicts:
#	src/PrebidMobile/PrebidMobile.xcodeproj/project.pbxproj
#	src/PrebidMobile/PrebidMobile/RequestBuilder.swift
#	src/PrebidMobile/PrebidMobileTests/TargetingTests.swift
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 30, 2019

@ppuviarasu, I have removed PBMViewTool changes and created issue #225. Merge conflicts were solved

…ty_data

# Conflicts:
#	src/PrebidMobile/PrebidMobile.xcodeproj/project.pbxproj
@yoalex5 yoalex5 requested a review from ppuviarasu July 30, 2019 14:16
yoalex5 added 2 commits July 30, 2019 23:18
…ty_data

# Conflicts:
#	src/PrebidMobile/PrebidMobile/Constants.swift
#	src/PrebidMobile/PrebidMobile/RequestBuilder.swift
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 30, 2019

@ppuviarasu, I have fixed conflicts, could you please check it ?

@ppuviarasu ppuviarasu merged commit ab1b4e6 into prebid:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants