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

Add cpmDistribution function for Google Analytics adapter #4240

Merged
merged 3 commits into from
Oct 22, 2019

Conversation

muuki88
Copy link
Collaborator

@muuki88 muuki88 commented Sep 27, 2019

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Add an additional option cpmDistribution to the google analytics adapter to allow customization of the cpm buckets.

Copy link
Contributor

@msm0504 msm0504 left a comment

Choose a reason for hiding this comment

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

Are there unit tests to go with these changes? Looks like few tests have been written for the googleAnalyticsAdapter as a whole

@muuki88
Copy link
Collaborator Author

muuki88 commented Oct 10, 2019

The test coverage of the analytics adapter is rather poor. I can try to add more if you think this makes sense, but I would appreciate some hints as I'm not sure how to mock things to verify the proper methods are being called.

Also the implementation with a separate queue is a bit strange as GA already provides an API for that, which may make tests even trickier.

@muuki88
Copy link
Collaborator Author

muuki88 commented Oct 10, 2019

I added a test without the mocking stuff. I'm puzzled that I can't call enableAnalytics twice, which makes it impossible to write isolated test cases. The AdapterManager doesn't seem to override this method, but it hell looks like it 😄

@muuki88 muuki88 requested a review from msm0504 October 10, 2019 08:32
Copy link
Contributor

@msm0504 msm0504 left a comment

Choose a reason for hiding this comment

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

The code change to the adapter seems fine to me, so I'll approve this.

I'll ask in the prebid-js slack about writing the tests, since those should be added for the adapter as a whole.

@msm0504 msm0504 merged commit f92650f into prebid:master Oct 22, 2019
@muuki88 muuki88 deleted the ga-adapter-cpm-distribution branch October 24, 2019 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants