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

PubWise.io Analytics Module Update - SPOT Support, Module Rules & Minor Features #5677

Merged
merged 9 commits into from
Sep 9, 2020

Conversation

GLStephen
Copy link
Collaborator

@GLStephen GLStephen commented Aug 30, 2020

Type of change

  • [ X ] Feature

Description of change

  • Refactor to make compliant with current module rules
  • Addition of ActivationID
  • Event batching, sessions, etc. to support Smart Path Optimization Technology
  • Improvements to testing
  • Support new event types

Test Params

 pbjs.enableAnalytics({
  provider: 'pubwise',
  options: {
    site: 'b1ccf317-a6fc-428d-ba69-0c9c208aa61c'    
  }
 });

@GLStephen GLStephen marked this pull request as draft September 1, 2020 13:52
@GLStephen
Copy link
Collaborator Author

I'm converting this to a draft while we figure out the Browserstack issue.

@GLStephen GLStephen marked this pull request as ready for review September 1, 2020 18:44
Copy link
Contributor

@musikele musikele left a comment

Choose a reason for hiding this comment

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

Test coverage is at 78%, lower than our accepted minimum that is 80%. Please try to improve line coverage the best you can

Copy link
Contributor

@musikele musikele left a comment

Choose a reason for hiding this comment

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

have a look at suggestions i left regarding the code.

modules/pubwiseAnalyticsAdapter.js Outdated Show resolved Hide resolved
@GLStephen
Copy link
Collaborator Author

@musikele thanks for the review, the storageManager removal was a regression. We'll get that fixed and look at the other items.

@GLStephen
Copy link
Collaborator Author

@musikele Updates have been made. Let me know if you need anything further.

Copy link
Contributor

@musikele musikele left a comment

Choose a reason for hiding this comment

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

Hi @GLStephen , found another issue while testing this functionality. If I configure the adapter with default values as specified in docs, I get network errors in console. Can you have a look at it?

pubwiseAnalytics.adapterEnableAnalytics = pubwiseAnalytics.enableAnalytics;

pubwiseAnalytics.enableAnalytics = function (config) {
if (config.options.debug === undefined) {
config.options.debug = utils.debugTurnedOn();
}
configOptions = config.options;
Copy link
Contributor

Choose a reason for hiding this comment

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

So, I have probably found an issue here. Based on the docs you've written at the top of this file, I added these lines to my test page:

pbjs.enableAnalytics({
          provider: "pubwise",
          options: {
            site: "test-test-test-test",
          },
        });

when the execution gets here, configOptions.endpoint was set to defaultUrl, but that gets removed by this assignment:

configOptions = config.options;

As a result, i see a bunch of errors in console:

POST http://localhost:9999/integrationExamples/gpt/undefined 405 (Method Not Allowed)
(anonymous) @ ajax.js:91
flushEvents @ pubwiseAnalyticsAdapter.js:171
...
Prebid ERROR: xhr error null Method Not Allowed

Note the undefined at the end of the url.

So, configOptions.endpoint does not exist anymore.

I think you wanted to extend configOptions with the data coming from function arguments:

configOptions = {
    ...configOptions, 
    ...config.options  
}

(This can be also achieved by using Object.assign)

Can you have a look into this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@musikele this is resolved now

@GLStephen
Copy link
Collaborator Author

@musikele thanks for the catch on that, I've also updated to use a reserved ID for testing so that the API will return proper responses, so the old test-test-test-test will now return an "over quota" response.

Copy link
Contributor

@musikele musikele left a comment

Choose a reason for hiding this comment

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

LGTM

@musikele musikele merged commit b071457 into prebid:master Sep 9, 2020
BrightMountainMediaInc pushed a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
…or Features (prebid#5677)

* updates to bring module up to current module rules, lints, etc. also add activationId and improve tests

* fix eslint error

* Fix IE11 Includes Check Failing Tests

* revert debug setting

* updates to fix PR review issues

* updates to fix default params handling
BrightMountainMediaInc pushed a commit to BrightMountainMediaInc/Prebid.js that referenced this pull request Sep 14, 2020
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