Configuration

Property ID

The Property ID identifies the website (i.e., the "property") that the MediaVoice Plugin is installed on. Every distinct website must have a unique Property ID, in order to enable detailed reporting.

Your account manager will provide you with the necessary Property ID(s).

For prototyping purposes, the default value of NA-TEST-11235814 can be used.

Property ID

Configure Native Ad Placement

Handlebars Compiler

Configure Content Page

Hosted Content

Hosted Template URL

Enter the Hosted Template URL. For example: /sample/publisher/sponsored/.

This URL is accessed when the user clicks on the Native Ad Placement.

The ?mvi= query string parameter is automatically appended to the URL. This value of this parameter identifies the creative ID in the MediaVoice system.

For reliable operation, the URL must be an Absolute Path (i.e., it must start with a /.). Thus, this URL must not be an Absolute URL or Relative Path.

For example:

  • Absolute Path: /sponsored.html, /sponsored/
  • Absolute URL: http://mediavoice.com/sponsored, http://example.com/sponsored/ http://example.com/sponsored.html
  • Relative Path: ../sponsored/, ../sponsored/

Hosted Template URL
Page Placement

Enter (jQuery) selectors.

The plugin will execute on the page referenced by Hosted Template URL, and will automatically substitute creative fields (for example, the title, sponsor, summary, etc.) into the locations indicated by the provided selectors.

These selectors are provided as configuration options to enable re-using existing templates from your CMS.

Sponsor Name
Sponsor Logo
Sponsor Link
Title
Summary
Content
Author
Publish Date
Media
Media Credits
Media Caption
Callbacks: Custom Logic

onRender callback

A callback function that is executed immediately after the hosted content page has successfully completed rendering.

This function receives no parameters, and can be used for numerous purposes, such as hiding a loading screen.


onError callback

A callback function that is executed if an error occurs while attempting to render the hosted content page.

This function receives a single parameter, an object describing the error condition. The function can be used for numerous purposes, such as displaying an error to the user.


onFill callback

A callback function that is executed immediately before the hosted content page begins rendering (but after the creative data is filled from the API server).

This function receives a single parameter, the data that is returned from the API. You can manipulate data from the API here.

Generate Code

Internal Content

Callbacks: Custom Logic

track callback

A callback function that is executed only when the plugin cannot determine whether the page should be tracked or not. This happens on page views to Internal Content pages that were not directly triggered by an ad clickthrough.

Your function must decide whether the page should be tracked by the plugin, and if so, return "inbound".

The following sample implementation of track checks if the pathname of the page contains the word sponsored and returns inbound if that condition is true. You can use a similar condition based on the page URL or any other condition that is valid for your sponsored content pages.


function() {
  if (location.pathname.indexOf('sponsored') >= 0) {
    return "inbound";
  }
}


The page's HTML must also contain a canonical link element in the head element. For example:

<head><link rel="canonical" href="http://publisher.example/article.html"></head>

Generate Code

Code Results

Place the following <script></script> tags immediately before the closing </body> tag.

Note that this is just JavaScript. Feel free to edit this code to add any custom logic.

 

Tap the button below to convert the generated code into a script.

Create Script

To install this script, drag the link below to your browser's bookmarks bar.

MediaVoice (Generated Script)

Keyboard Shortcuts

L Navigate to Native Ad Placement Location
M Navigate to Native Ad Placement Template
G Generate Code
B Create Script (Bookmarklet)
? Show Keyboard Shortcuts