Yieldmo Synthetic Inventory Module: add new module#7537
Conversation
a418a15 to
e04dd0e
Compare
44e1738 to
228b42a
Compare
There was a problem hiding this comment.
@ym-abaranov If google tag is undefined then this module won't work and we should throw some error. In the above line 5 we should do the same.
There was a problem hiding this comment.
@desidiver we are defining an instance of googletag and pushing a callback, so later when the GPT will be initialized it will work okay. I've also added required params validation, now it's throwing an err.
56a9183 to
8af004d
Compare
|
@Fawke any feedback on this PR? Thank you. |
|
@desidiver it looks like this branch just needs to pull in recent commits to master to fix the errors. There was a linting error that briefly was merged before I could fix it and that must have been the master branch at the time of this pr. We rewrote all |
8af004d to
7467024
Compare
Fawke
left a comment
There was a problem hiding this comment.
Hi @ym-abaranov,
The test coverage for this module is only 50%. Can you please make it at least 80% or more?
Also, I'm not sure about accessing googletag global object in the module. Adding @bretg for more clarification to see if we wanna allow it or not. Going through the Module Rules, I didn't find anything against this usage, but since I didn't find any other module accessing this object, I just want to confirm if this is allowed.
|
Hi @Fawke, |
|
There are lots of files in the modules directory that refer to googletag, so in general this is fine. However, glancing briefly at how this module is doing it, doesn't seem consistent with others. There's a utils function called For instance, the Rubicon Analytics Adapter has what seems like a good way to handle it. Here it is generalized a bit: Adding @harpere to weigh in on whether whether this module's implementation of googletag is ok. My gut feeling is that assigning window.top.googletag without first checking that it exists is a problem. Sounds like this might be another thing that needs to be checked by reviewers, but first we need consensus on the right approach. |
|
@bretg Assuming we're ok with the module accessing GPT, I think the way it's being done is fine. If After that, all references to So won't be executed until GPT has loaded, and will be executed immediately if it already has. |
6751fd0 to
e083f86
Compare
… of window.top.googletag)
e083f86 to
7a9c720
Compare
* Yieldmo Synthetic Inventory Module: initial commit * Updating Documentation * Test coverage improved * Fixes after PR (using isGptPubadsDefined and window.googletag instead of window.top.googletag) Co-authored-by: Nayan <nsavla@yieldmo.com> Co-authored-by: Dmitriy Labuzov <dlabuzov@yieldmo.com>
Type of change
New module. A link to a PR on docs repo here -- prebid/prebid.github.io#3322