washingtonpost / arcads Goto Github PK
View Code? Open in Web Editor NEWArcAds is a DFP wrapper created by Arc XP with publishers in mind.
Home Page: https://www.npmjs.com/package/arcads
License: MIT License
ArcAds is a DFP wrapper created by Arc XP with publishers in mind.
Home Page: https://www.npmjs.com/package/arcads
License: MIT License
We'd like to give other keys than code and bids to adUnit object with prebid.
It is for monitoring purposes.
const adUnit = { code: 'adunit', pubstack: 'adunit_monitoring', bids: [] }
const adUnit = { code: 'adunit', bids: [] }
Is it possible to implement something like this :
(source concerned : https://github.com/washingtonpost/ArcAds/blob/master/src/services/prebid.js)
I am trying to setup a demo page with the sample from prebid.org. Here's the code snippet I am using:
arcAds.registerAd({
id: 'div-1',
slotName: 'header-bid-tag-0',
adType: 'leaderboard',
display: 'all',
dimensions: '[[970, 250], [970, 90], [728, 90]]',
sizemap: {
breakpoints: '[ [1280, 0] ]',
// refresh: 'leaderboard'
},
bidding: {
prebid: {
enabled: true,
bids: [{
bidder: 'appnexus',
labels: ['desktop'],
params: {
placementId: '13144370'
}
}]
}
}
})
Receive the bid from the auction request.
The auction failed with a {"error":"parse"}
message.
Looking into the bid request, you'll see the sizes[] from the payload is empty:
{
"tags": [{
"sizes": [],
"ad_types": ["banner"],
"uuid": "275015f90ea6f6",
"id": 13144370,
"allow_smaller_sizes": false,
"use_pmt_rule": false,
"prebid": true,
"disable_psa": true
}],
"sdk": {
"source": "pbjs",
"version": "1.15.0"
}
}
Is there anything I've missed from the code? Or set the sizemap
incorrectly?
Thank you so much for sharing the project. Any help would be appreciated.
npm audit fix
────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.6.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ arcads │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ arcads > esdoc > marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/812 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Regular Expression Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.6.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ arcads │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ arcads > esdoc-standard-plugin > esdoc-publish-html-plugin > │
│ │ marked │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/812 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimist │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.2.1 <1.0.0 || >=1.2.3 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ arcads │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ arcads > esdoc > minimist │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1179 │
└───────────────┴──────────────────────────────────────────────────────
npm audit
or yarn audit
https://www.npmjs.com/advisories/1179
ArcAds library has ability to accept configs for collapseEmptyDiv but that collapse only happens at the interior div level - APD repo has to add padding at a parent container level and collapseEmptyDiv doesn't collapse at the parent arcAds component level so if an ad is empty even tho it does collapse at the interior dev arcAds level it does not at that parent container arcAds component level. For that case the padding is still seen even tho there is no ad. Is this an option we can include for arcAds? hiding/collapsing of any parent component divs/ids/classes perhaps?
Reference to PR for https://github.com/wapopartners/AppleDaily-PageBuilder-Fusion-Features/pull/697
User story
As a developer, I want to be able to consistently see certain problematic ads in my local environment, so that I can debug issues reported with them
As an adops manager, I want to be able to visualize how a page will look with a certain ad campaign, so that I can show it to potential clients
Context
We've implemented this functionality for Arc clients before and I think it would be useful for any user of ArcAds. Essentially, if the parameter ?adzone is added to a URL, we replace the ad unit that would normally be on the page (what is in slotName in ArcAds)with the value of the parameter. For example, http://www.website.com/?adzone=test/arc would replace an ad unit that's normally on this page (e.g. homepage) with the value in the parameter (test/arc).
Adops team can target specific ads only to this this ad unit, if there are issues that need to be addressed with certain ad types. This helps the developers not have to spend time searching for pages that have a particular ad targeted to them.
Arc partners have also found it helpful to be able to show an advertising client how their campaign will look. They can set up a test ad unit like test/client-name and show what the homepage will look like with all the creatives in that vendor's campaign, for example.
Acceptance criteria
I'm hoping to learn if you've thought about incorporating lazy loading into this library. Perhaps with IntersectionObserver?
Currently all of the ads load when the page loads.
Something that has been requested is the ability to configure a KV pair through a query parameter for ad slot targeting. For instance this might look something like ?kv=weather/hot
which will send a targeting parameter to all DFP ads of thing
and other
. This can be used for social referrals to prevent/cause the display of certain ads.
The current solution do not support web interstitial ad (https://developers.google.com/publisher-tag/samples/display-web-interstitial-ad)
Change the following endpoint:
Hi all,
I need to add on prebidjs call some additional params:
pbjs.bidderSettings = {
onetag:{
bidCpmAdjustment:function(bidCpm, bid){
return bidCpm * 0.9;
}
},
criteo:{
bidCpmAdjustment:function(bidCpm, bid){
return bidCpm * 1;
}
},
};
And:
pbjs.setConfig({
currency: currencyConfig,
priceGranularity: granularityConfig,
consentManagement: iabConfig,
schain: sChainConfig,
userSync: userSyncConfig,
});
Where i can integrate this portions of code correctly? (if it's possibile).
Thanks a lot.
An option for dfp to request non-personalized ads via setRequestNonPersonalizedAds
gpt option
No option available for non-personalized ads
This is very important for European publishers to be GDPR compliant
Single request to ask for every slot in the page
One request to GPT for each slot in the page
I have an array of slots:
const ads = [];
slots.forEach(slot => {
ads.push(
{
id: slot.id,
slotName: slot.name,
dimensions: slot.sizes,
}
);
});
arcads.registerAdCollection(ads);
This generates 1 request for each slot in the slots collection.
Hi,
I'm with CMG and I've noticed the following bug with ArcAds that is impacting ads revenue for us.
The resize based fetchBids
/refreshSlot
requests should trigger only when the page is resized beyond a breakpoint.
The resize based fetchBids
/refreshSlot
requests are triggered on first resize
event on the page regardless of window width (Sometimes the resize
event is triggered by the browser on page load, without any actual change in the window's width, however, this is not an ArcAds bug, but it certainly exacerbates the ArcAds bug described).
/gampad.+hp01/
for the HP01
slot or any other slot on the page.When a user resizes the window's width for the first time after page load, the callback produced by runResizeEvents should only fire if the width change is past a breakpoint, as described in the docs for the function:
Resize event that checks if a user has resized past a breakpoint included in the advertisements sizemap.
However, because the initial value of lastBreakpoint
is undefined
, then the lastBreakpoint !== breakpoint
condition is satisfied as well as (width > breakpoint && (width < nextBreakpoint || !nextBreakpoint)
for one breakpoint
in [0, 768, 1024] on this line.
As a result fetchBids
/refreshSlot
is triggered unnecessarily leading to unnecessary ad requests for each ad slot.
Note that once lastBreakpoint
is set after the initial call, this incorrect behavior goes away.
But to make matters worse, some desktop browsers trigger a resize
event on the window after page load and because runResizeEvents
is added to the window's resize
EventListener, all ad slot requests are doubled, once on page load, and once on the subsequent unexpected resize
event on the window that follows.
I have created the following Pull Request to address the issue: #83.
Please advise on how we should proceed.
It would be ideal if we had an NPM version with the latest build from master.
When ad slots don't get filled, the empty divs should collapse by default.
Divs that are used by ads slots that don't get filled, do not collapse. These divs introduce blank spaces in the layout.
Catch an ad slot that does not deliver creative, or schedule a slot to deliver an empty creative.
Further details for implementation can be found here:
https://support.google.com/admanager/answer/3072674?hl=en
Desired default behavior for instances when ad slots get filled most of the time:
Add googletag.pubads().collapseEmptyDivs(); to the portion of your page to collapse a particular div only when an ad doesn't serve to its ad slot. If a slot isn't filled, the div collapses, possibly moving the page content up with it and reflowing the page.
The ad Unit Properties only use
but send:
ArcAds/src/services/headerbidding.js
Lines 89 to 95 in d58dbad
ArcAds/src/services/headerbidding.js
Line 100 in d58dbad
Line 21 in d58dbad
Does this library support instream video?
So i cloned the the code and made some modifications in gpt.js and index.js but when i compiled the arcads.js did not work, I also tried to reclone and without modifications tried some basic ArcAds code but the arcads.js still did not respond. I know the code i wrote works because i copy pasted arcads.js from this git but not when i cloned it. I have a hard time understanding how i can make it work, could i be missing something? Would be very helpful if someone could help.
Hi, @nealmalkaniwapo, a vulnerability CVE-2021-33587 is introduced in arcads via:
● [email protected] ➔ [email protected] ➔ [email protected] ➔ [email protected] ➔ [email protected]
However, esdoc is a legacy package, which has not been maintained for about 2 years.
Is it possible to migrate esdoc to other package to remediate this vulnerability?
I noticed a migration record in other js repo for esdoc:
● in crest2d, version 1.1.2, migrated from esdoc to jsdoc via commit
● in wootils, version 3.0.4, migrated from esdoc to jsdoc via commit
Are there any efforts planned that would remediate this vulnerability or migrate esdoc?
Thanks.
As ArcAds spins into open source we'd like to increase its test coverage over all. We should be testing the library with mock ad calls to ensure that they are being created correctly. I'm going to leave this as an open issue for discussion as I figure out what direction this needs to take.
Hello,
I'd like to refresh ads each 30 seconds with a new bid each time.
Is there a way do to so without forking the module ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.