-
Notifications
You must be signed in to change notification settings - Fork 1
Player integration for Freewheel video ad server #177
base: master
Are you sure you want to change the base?
Conversation
|
||
vastUrl (videoMeta) { | ||
let baseUrl = `http://${SETTINGS.FREEWHEEL_NETWORK_ID}v.fwmrm.net/ad/g/1?`; |
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.
@MelizzaP missing a .
between the network id and the v
. Example (http://1b656.v.fwmrm.net/ad/g/1?...
)
base: { | ||
BULBS_ELEMENTS_ONIONSTUDIOS_GA_ID: 'UA-223393-14', | ||
BULBS_ELEMENTS_COMSCORE_ID: '6036328', | ||
RESP: 'vmap1', |
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.
I think we can just hardcode this instead of making it a setting, it'll never change.
RESP: 'vmap1', | ||
}, | ||
development: { | ||
FREEWHEEL_NETWORK_ID: '111976', |
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.
I think these network IDs should actually be stored in each property's python settings and then passed into the the bulbs-element somehow, maybe even as a namespaced variable on window
. I don't believe the NODE_ENV
gives you what you need to integrate into each of the bulbs properties, but I'd want to @collin to weigh in.
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.
my logic behind it was that they were the same for each site, so we wouldn't have to repeat them. And I just felt weird about putting them on the window.
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.
So far we've been kicking the can down the road on some of these bulbs-elements settings.
I think this is a good step to have a module that exports settings.
Maybe we could add a settings object to the properties header (before bulbs-elements is loaded).
<script>
window.BULBS_ELEMENTS_SETTINGS = {};
</script>
And in settings.js
if (window.BULBS_ELEMENTS_SETTINGS) {
Object.assign(settings, window.BULBS_ELEMENTS_SETTINGS);
}
Then we can decide where a setting should live on a case-by-case basis.
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.
In the long-term I'd like to get bulbs-elements
into omni
and find some way to access the python settings at build time. Then we could have one settings file for everything.
But 1 settings.py location and 1 settings.js location beats having these settings strewn about the individual js files.
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.
if the end goal is to have all the settings in one settings.py
file and we are pushing these settings to window
anyway. I'd argue, it might make sense to just put them in each sites' settings.py
file. Having a settings.js
and settings.py
file just seems to add an unnecessary and possibly confusing extra layer of complication.
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.
👍
global.BULBS_ELEMENTS_ONIONSTUDIOS_GA_ID = 'UA-223393-14'; | ||
global.BULBS_ELEMENTS_COMSCORE_ID = '6036328'; | ||
global.BULBS_ELEMENTS_ONIONSTUDIOS_GA_ID = SETTINGS.BULBS_ELEMENTS_ONIONSTUDIOS_GA_ID; | ||
global.BULBS_ELEMENTS_COMSCORE_ID = SETTINGS.BULBS_ELEMENTS_COMSCORE_ID; |
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.
Rather than dump this on settings, I think we should just read it from SETTINGS
every time we use these values.
} | ||
|
||
getCsidValue (videoMeta) { | ||
let deviceAcronym = this.setDeviceAcronym(); |
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.
Can we make this getDeviceAcronym
to stay consistent with those other accessor functions?
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.
I was trying to differentiate from values we are pulling in from other places the vs values we are setting.
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.
but I suppose its really 6 of one half a dozen of the other
} | ||
} | ||
|
||
getCsidValue (videoMeta) { |
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.
We should try to make the method name for this much more descriptive than getCsidValue
because csid
is sort of cryptic. Maybe getSiteSection
?
} | ||
|
||
getSiteName () { | ||
return window.location.host.split('.')[1]; |
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.
We actually want this to be the target_channel
set as dimension1
further up in Revealed.js
. It's meant to be the channel code of the video you're playing, not necessarily the site it is playing on. For instance, if we're playing an labs video on The Onion, we wouldn't want the theonion
passed up as the site name.
I'm not sure we actually need this method at all, since we should be able to pull this value direct from the video props
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.
some videos have their target_channel
set to onion-labs
, do we want that value or should I just make it default to theonion?
6f04999
to
8bfd453
Compare
8bfd453
to
74f7633
Compare
67f02b0
to
197df85
Compare
return dfpSection; | ||
} | ||
|
||
buildCsid (hostChannel) { |
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.
buildCustomSiteSectionId
return `${deviceAcronym}.${siteName}_${siteSection}_${hostChannel}`; | ||
} | ||
|
||
buildCaid (videohubReferenceId) { |
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.
buildCustomContentVideoAssetId
let campaignId = this.props.targetCampaignId; | ||
let specialCoverage = this.props.targetSpecialCoverage; | ||
|
||
let baseUrl = `http://${window.FREEWHEEL_NETWORK_ID}.v.fwmrm.net/ad/g/1?`; |
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.
This should be the freewheel network hash
|
||
let baseUrl = `http://${window.FREEWHEEL_NETWORK_ID}.v.fwmrm.net/ad/g/1?`; | ||
|
||
// required global params |
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.
We are missing the nw
param, which should be window.FREEWHEEL_NETWORK_ID
baseUrl += '&vprn=' + randomVideoPlayerNumber; | ||
|
||
// optional global param | ||
if (vastTestId) { baseUrl += '&cana=' + vastTestId; } |
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.
Let's modify this line in vastTest
:
let vastId = this.parseParam('xgid', searchString);
So we make the parameter (which is ad placement id), let's call it apid
if (vastTestId) { baseUrl += '&cana=' + vastTestId; } | ||
|
||
// Key Values | ||
baseUrl += ';&video_id=' + videohubReferenceId; |
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.
We shouldn't need the ampersand after the semi-colon, so ;&video_id
becomes ;video_id
if (specialCoverage) { baseUrl += '&special_coverage=' + specialCoverage; } | ||
|
||
// Slot Params *Required Fields* | ||
baseUrl += ';&slid=' + 'Preroll'; |
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.
We shouldn't need the ampersand after the semi-colon, so ;&slid
becomes ;slid
…id" and add nw parameter to vastUrl
… contain FREEWHEEL_NETWORK_ID and FREEWHEEL_NETWORK_HASH properties
} | ||
|
||
buildCustomSiteSectionId (hostChannel) { | ||
// format: <device acronym>.<site name>_<dfp section>_<host channel> |
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.
I think we can remove this comment, because that format is clear in the interpolation below
} | ||
|
||
buildCustomContentVideoAssetId (videohubReferenceId) { | ||
// format: onion_<videohub reference id> |
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.
I think we can remove this comment, because that format is clear in the interpolation below
Updating the query in
revealed.js
for the new Freewheel ad server.Test Links
http://freewheel.test.avclub.com
http://freewheel.test.theonion.com
http://freewheel.test.clickhole.com
to test open javascript console in your browser, inside of the network tab, you can filter by
XHR
there should be a request to this urlhttp://111976.v.fwmrm.net
after you click play on a video