Only works with DCM tag in AppNexus where rendering-mode
is set to script
.
<ins class='dcmads' style='display:inline-block;width:970px;height:250px' data-dcm-placement='N53802.2578805TMP2/B21984236.233625653' data-dcm-rendering-mode='script' data-dcm-https-only data-dcm-resettable-device-id='' data-dcm-app-id='' data-dcm-click-tracker=${CLICK_URL}_____CP_ID:${CP_ID}_____ data-dcm-param-lineID='${CP_ID}'> <script src='https://www.googletagservices.com/dcm/dcmads.js'></script> </ins>
The creative should post an event with name REQUEST_CAR_INFO
to the parent, and will receive an event with name CAR_INFO
and an object called carInfo
.
window.addEventListener('message', function(e) { if (e.data && e.data.name === 'REQUEST_CAR_INFO') { var carInfo = {merk:'geen-seat'}; try { carInfo = { model: parent.parent.raw_model, bouwjaar: parent.parent.raw_modelId, merk: parent.parent.window.raw_make, } } catch(e) { var u = /seat-([a-z]*)/g.exec(window.location.search); if (u) { carInfo = { model: u[1], bouwjaar: 0, merk: 'seat', } } } e.source.postMessage({name: 'CAR_INFO', carInfo: carInfo}, '*') } })