Giter VIP home page Giter VIP logo

ams-hb's People

Contributors

vdias38 avatar

Watchers

 avatar  avatar

ams-hb's Issues

mergeRecursive is removing default properties

var defaultSettings = {
            analytics: {
                trackAdblock: true,
                trackPrebid: false,
            },    
            autoRefresh: {
                interval: 15000, // milliseconds
                minVisibility: 0.75, // range 0-1
                onlyIfBidWinner: true
            },
            // prebidAdUnits: ["6544251"],
            bidTimeout: 1200
        }

var localSettings = {
    siteId: '909426',
    prebidAdUnitIds: ["6544251"],
    autoRefresh: {
        interval: 35000, // milliseconds
        minVisibility: 0.49, // range 0-1
        // onlyIfBidWinner
    },
}

Expected result is:

{
            analytics: {
                trackAdblock: true,
                trackPrebid: false,
            },    
            autoRefresh: {
                interval: 35000, // milliseconds
                minVisibility: 0.49, // range 0-1
                onlyIfBidWinner: true
            },
            // prebidAdUnits: ["6544251"],
            bidTimeout: 1200
        }

but we observe following result, where autoRefresh.onlyIfBidWinner is missing:

{
            analytics: {
                trackAdblock: true,
                trackPrebid: false,
            },    
            autoRefresh: {
                interval: 35000, // milliseconds
                minVisibility: 0.49, // range 0-1
            },
            // prebidAdUnits: ["6544251"],
            bidTimeout: 1200
        }

refresh prebid when adUnit.auto-refresh is true

Add auto-refresh property on AdUnits declarations
Should define a period (interval) of auto-refresh in seconds, this period could be customized through API (pbAMS.setIntervalRefresh in seconds)

allow to launch hb programatically from another js

Due to GDPR implementation on all EU websites the hb should wait for user autorisation before running. This autorization could be the result of an interaction:popup to agree, or automatic is cookies already setted.

We can simulate this interaction via window confirm() method

Should be the rule to wait for call.

Maybe we can consider using dispatchEvent

how to deal with current DOMContentLoaded trigger ?

add sizeConfig parameter to the pbjs.setConfig

add hbAMS.settings.sizeswith

desktop: [
"970, 250",
"970, 90",
"728, 90",
"300, 600",
"300, 250"
],
tablet: [...],
phone: [...]

add sizeConfig on pbjs.SetConfig

 sizeConfig: [{
    'mediaQuery': '(min-width: 1024px)',
    'sizesSupported': hbAMS.settings.sizes.desktop,
    'labels': ['desktop']
}, {
    'mediaQuery': '(min-width: 768px) and (max-width: 1023px)',
    'sizesSupported': hbAMS.settings.sizes.tabler,
    'labels': ['tablet']
}, {
    'mediaQuery': '(min-width: 0px) and (max-width: 767px)',
    'sizesSupported': hbAMS.settings.sizes.phone,
    'labels': ['phone']
}]

update of mas demo

forward gdpr values to adserver as params

Find below and example of adServer params including new gdpr params

        adServer.config = {
            protocol: 'https',
            server: 'secserv.adtech.de',
            network: '1502.1',
            siteid: siteId,
            params: {
                loc: '100',
                kvcat: kvpage + '',
                kvref: urlref + '',
                kvrefhb: urlref + '',
                kvurlend: urlend + '',
                gdpr_consent : consentData,
                gdpr = gdprApplies,
                gdpr_pd = 0
            }
        }
  • gdpr_consent is a String (example : "BON2odxON2odxAOABAENAUIAAAALeACAAyACcA")
  • gdprApplies is a Boolean. Should be equals to 1 in EU else 0.
  • gdpr_pd is always 0

A test page including a CMP : https://ams-cmp.firebaseapp.com/test-cmp.html
We should copy the code to run a CMP on our own demo page.

pbAMS.setAdUnitsMode auto|manual

before prebid request pbAMS should define AdUnits array. If adUnitsMode is auto should parse DOM to find adUnits.code on page (div@id of div@class==ams-ad).

If manual then user should define adUnits to consider with function setAdUnits([ADUNIT_IDs])

pbAMS.setInitMode onload | oncall

Define if prebid is requested automatically on page load, onload, or explicit call, oncall.

onload

On document.eventlistener(DOMLoaded, PREBID_REQUEST(), false)

oncall

prebid request for single AdUnit on dynamic call (used for DFP integration)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.