The New Relic thePlatform JS tracker instruments thePlatform HTML5 player.
Install dependencies:
$ npm install
And build:
$ npm run build:dev
Or if you need a production build:
$ npm run build
If
dist
folder is not included, runnpm i && npm run build
to build it.
You have 2 options:
Load scripts inside dist
folder into your page.
nrvideo.Core.addTracker(new nrvideo.ThePlatformTracker(player))
Alternatively, you can use the Platform official ecosystem:
<div id="player" class="tpPlayer"
tp:plugin0="type=tpplayer|URL=../dist/newrelic-video-theplatform.min.js|priority=1"
>
If you want to use scope, you can pass it as an option:
nrvideo.Core.addTracker(new nrvideo.ThePlatformTracker(player, {
scope: 'SCOPE'
}))
or you can use theplatform plugin space:
tp:plugin0="type=tpplayer|URL=../dist/newrelic-video-theplatform.min.js|priority=1|scope=SCOPE"
Check out the samples
folder for complete usage examples.
Due to the information exposed by player provider, this tracker may not be able to report:
AD_QUARTILE
.AD_CLICK
.AD_RENDITION_CHANGE
.BUFFER
only available for HLS (seeOnMediaBufferStart
on The Platform docs).
This project is distributed under the Apache 2 license.
New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.
We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.
New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:
https://discuss.newrelic.com/t/theplatform-js-tracker/100302
Issues and enhancement requests can be submitted in the Issues tab of this repository. Please search for and review the existing open issues before submitting a new issue.
Contributions are encouraged! If you submit an enhancement request, we'll invite you to contribute the change yourself. Please review our Contributors Guide.
Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at opensource+videoagent@newrelic.com.