-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Appnexus native view tracker #4022
Conversation
…he bid's creation and fixed tests
…avascript_trackers) in the bidAdapter's newBid function
…or our jstracker and update their src attributes.
…dWon to arm it. This prevents the tracker from being loaded twice.
…inding the element will now fall be a view_js responsability.
…e/Prebid.js into appnexus_native_view_tracker
This pull request introduces 1 alert when merging e04275d into c2bdb94 - view on LGTM.com new alerts:
This project has automated code review enabled, but doesn't use the LGTM GitHub App. Migrate over by installing the app. Read about the benefits of migrating to GitHub Apps in the blog. Comment posted by LGTM.com |
This pull request introduces 1 alert when merging 4057c13 into c2bdb94 - view on LGTM.com new alerts:
This project has automated code review enabled, but doesn't use the LGTM GitHub App. Migrate over by installing the app. Read about the benefits of migrating to GitHub Apps in the blog. Comment posted by LGTM.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Seems like a lot of code to add to the adapter, any chance we can host this code / download it only for native responses?
* First pass: adding viewability script to rtbBid * Added viewability scrit in the right place * Clean up * Corrected script position, added a workaround to get the adId after the bid's creation and fixed tests * Removed debugging logs * More cleanup * Opted to append rtbBid.viewability.config to the existing (nativeAd.javascript_trackers) in the bidAdapter's newBid function * Removed AnalyticsAdaper code and added bidAdapter.onBidWon to check for our jstracker and update their src attributes. * Added a way to differentiate scripts and clean up * Changed newBid to disarm jstracker before it's ready and changed onBidWon to arm it. This prevents the tracker from being loaded twice. * Making the code more robust * Grouped code in a function. Also changed parameters to reflect that finding the element will now fall be a view_js responsability. * Changed parameter pbjs_iframeid name to pbjs_auc so its not misleading * Variable name change to better reflect its nature * Fixing URL parameters (; separated and replacing completely the useless one) * undo changes to appnexus Analytics adapter * update regex variable * update regex again
* First pass: adding viewability script to rtbBid * Added viewability scrit in the right place * Clean up * Corrected script position, added a workaround to get the adId after the bid's creation and fixed tests * Removed debugging logs * More cleanup * Opted to append rtbBid.viewability.config to the existing (nativeAd.javascript_trackers) in the bidAdapter's newBid function * Removed AnalyticsAdaper code and added bidAdapter.onBidWon to check for our jstracker and update their src attributes. * Added a way to differentiate scripts and clean up * Changed newBid to disarm jstracker before it's ready and changed onBidWon to arm it. This prevents the tracker from being loaded twice. * Making the code more robust * Grouped code in a function. Also changed parameters to reflect that finding the element will now fall be a view_js responsability. * Changed parameter pbjs_iframeid name to pbjs_auc so its not misleading * Variable name change to better reflect its nature * Fixing URL parameters (; separated and replacing completely the useless one) * undo changes to appnexus Analytics adapter * update regex variable * update regex again
* First pass: adding viewability script to rtbBid * Added viewability scrit in the right place * Clean up * Corrected script position, added a workaround to get the adId after the bid's creation and fixed tests * Removed debugging logs * More cleanup * Opted to append rtbBid.viewability.config to the existing (nativeAd.javascript_trackers) in the bidAdapter's newBid function * Removed AnalyticsAdaper code and added bidAdapter.onBidWon to check for our jstracker and update their src attributes. * Added a way to differentiate scripts and clean up * Changed newBid to disarm jstracker before it's ready and changed onBidWon to arm it. This prevents the tracker from being loaded twice. * Making the code more robust * Grouped code in a function. Also changed parameters to reflect that finding the element will now fall be a view_js responsability. * Changed parameter pbjs_iframeid name to pbjs_auc so its not misleading * Variable name change to better reflect its nature * Fixing URL parameters (; separated and replacing completely the useless one) * undo changes to appnexus Analytics adapter * update regex variable * update regex again
Type of change
Description of change
Adds some logic to incorporate the appnexus view-ability script for native bids.
As the script requires some information about the bid that's generated after it runs through the auction, there is some custom logic that will replace some place-holders values in the script before it executes on the page. This logic is triggered via the
onBidWon
adapter function.