Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Player integration for Freewheel video ad server #177

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

spra85
Copy link
Contributor

@spra85 spra85 commented Oct 11, 2016

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 url http://111976.v.fwmrm.net after you click play on a video


vastUrl (videoMeta) {
let baseUrl = `http://${SETTINGS.FREEWHEEL_NETWORK_ID}v.fwmrm.net/ad/g/1?`;
Copy link
Contributor Author

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',
Copy link
Contributor Author

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',
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

@MelizzaP MelizzaP Oct 11, 2016

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.

Copy link
Contributor

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;
Copy link
Contributor

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.

@MelizzaP MelizzaP changed the title (IN PROGRESS) Player integration for Freewheel video ad server Player integration for Freewheel video ad server Oct 11, 2016
}

getCsidValue (videoMeta) {
let deviceAcronym = this.setDeviceAcronym();
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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) {
Copy link
Contributor Author

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];
Copy link
Contributor Author

@spra85 spra85 Oct 11, 2016

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

Copy link
Contributor

@MelizzaP MelizzaP Oct 12, 2016

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?

@MelizzaP
Copy link
Contributor

return dfpSection;
}

buildCsid (hostChannel) {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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?`;
Copy link
Contributor Author

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
Copy link
Contributor Author

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; }
Copy link
Contributor Author

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;
Copy link
Contributor Author

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';
Copy link
Contributor Author

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

}

buildCustomSiteSectionId (hostChannel) {
// format: <device acronym>.<site name>_<dfp section>_<host channel>
Copy link
Contributor Author

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>
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants