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

Modify custom targeting after the auction happened #199

Merged
merged 10 commits into from
Jul 16, 2020
Merged

Conversation

yoalex5
Copy link
Collaborator

@yoalex5 yoalex5 commented Jun 10, 2020

Description and the main idea #198

As a developer I want to have a possibility to add extra custom targeting after bids were retrieved

Now publisher can pass an PublisherAdRequest.Builder

final PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();

adUnit.fetchDemand(builder, new OnCompleteListener() {
    @Override
    public void onComplete(ResultCode resultCode) {
        builder.addCustomTargeting("key1", "value1");
        PublisherAdRequest request = builder.build();
        amBanner.loadAd(request);
    }
});

Tim Rijckaert and others added 6 commits May 29, 2020 16:11
This allows users to add options after Prebid mutated the Request
- DemoApp uses `PublisherAdRequest.Builder`
- `testPublisherAdRequestBuilder()` test was added
- `testPublisherAdRequestBuilderWithRefresh()` was added
- small tests improvements
@yoalex5 yoalex5 added this to the 1.7 milestone Jun 10, 2020
@@ -468,6 +472,18 @@ private static void handleDFPCustomTargetingUpdate(HashMap<String, String> bids,
}
}

private static void handleAdManagerBuilderCustomTargeting(HashMap<String, String> bids, Object publisherAdRequestBuilder) {
Object publisherAdRequest = Util.callMethodOnObject(publisherAdRequestBuilder, "build");
removeUsedCustomTargetingForDFP(publisherAdRequest);
Copy link

@timrijckaert timrijckaert Jun 10, 2020

Choose a reason for hiding this comment

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

Is this correct?
The builder is able to build multiple PublisherAdRequests

This is not removing the custom targeting from the PublisherAdRequest$Builder, instead this is removing the custom targeting from the publisherAdRequest from line #476.
The returned publisherAdRequestBuilder build method will still contain the custom targeting.

Or am I missing something?
Might be worth a test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@timrijckaert, could you please review testPublisherAdRequest() test case ?

@bszekely1 bszekely1 modified the milestones: 1.7, 1.8 Jun 11, 2020
@bszekely1 bszekely1 requested review from ppuviarasu and anwzhang and removed request for ppuviarasu June 22, 2020 14:39
@bszekely1 bszekely1 modified the milestones: 1.8, 1.7 Jun 22, 2020
@yoalex5
Copy link
Collaborator Author

yoalex5 commented Jul 1, 2020

@anwzhang, could you please review this PR ?

@yoalex5 yoalex5 merged commit 05b5c90 into master Jul 16, 2020
@YuriyVelichkoPI YuriyVelichkoPI deleted the pull/198_targeting branch May 20, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants