Skip to content

Implement additional ad event confirmations #1890

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

Merged
merged 1 commit into from
Mar 11, 2019
Merged

Implement additional ad event confirmations #1890

merged 1 commit into from
Mar 11, 2019

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Mar 7, 2019

fixes brave/brave-browser#3587

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

  • Confirm clicked, viewed, dismissed and landed Ads are redeemed on Ads Serve and timed out Ads are not redeemed on Ads Serve

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@tmancey tmancey added this to the 0.63.x - Nightly milestone Mar 7, 2019
@tmancey tmancey self-assigned this Mar 7, 2019
@tmancey tmancey requested review from ryanml and NejcZdovc March 7, 2019 14:36
int total_viewed = 0;

for (const auto& transaction : info->transactions) {
if (transaction.confirmation_type != "view") {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this string into variable, so that we have it only in one place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

writer.String(time_stamp.c_str());

writer.String("notificationId");
writer.String(info.uuid.c_str());

std::string type;
switch (info.type) {
case ConfirmationType::UNKNOWN: {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we extract all this types into variable? (same as comment above)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

@@ -71,6 +76,21 @@ Result NotificationInfo::FromJson(
uuid = document["uuid"].GetString();
}

if (document.HasMember("confirmation_type")) {
std::string confirmation_type = document["confirmation_type"].GetString();
if (confirmation_type == "click") {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

break;
}

case ConfirmationType::CLICK: {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

break;
}

case ConfirmationType::CLICK: {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

break;
}

case ConfirmationType::CLICK: {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 fixed

@tmancey tmancey requested a review from NejcZdovc March 7, 2019 15:01
@tmancey tmancey force-pushed the issues/3587 branch 2 times, most recently from a808b3e to b416870 Compare March 7, 2019 16:38
@tmancey tmancey force-pushed the issues/3587 branch 2 times, most recently from 5518141 to 8f460b1 Compare March 11, 2019 12:07
@tmancey tmancey requested a review from emerick March 11, 2019 12:10
emerick
emerick previously approved these changes Mar 11, 2019
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@tmancey tmancey merged commit 439c608 into master Mar 11, 2019
@tmancey tmancey deleted the issues/3587 branch March 11, 2019 21:13
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.

Implement additional ad event confirmations
3 participants