Website Creation

All ad units should be grouped under a website for reporting and ad serving purposes.

To create a website, from the Monetization tab:

  • Click on “Websites and Ad Units” in the left menu
  • Click on “+ Website”
  • Enter a name for the Website
  • Enter the URLs needed.
  • Subdomains and subpages do not need to be added separately, but include an example of a page for every ad layout needed (e.g. Home page, Article). This can be used as part of the Ad Unit creation process.
  • Multiple urls can be added using a comma to separate each url, for example: http://www.publisher.com, http://www.publisher.ca, http://www.publisher.co.uk
  • Click “Save” and close the “+ Website” pop up using the “X” symbol
https://s.yimg.com/oo/cms/products/flurry-docs/publisher/images/Creating_flurry_site_84d6a42a3.png

Creating the Ad Unit

To create a new ad unit, from the Monetization tab:

  • Select “Websites and Ad Units” in the left menu
  • Click on “+ Ad Unit” and the “Create Ad Unit” page will open

From the Create Ad Unit page:

  • Enter a name in the “Ad Unit Name” text field.
  • This cannot be changed later, so choose carefully.
  • Select the website the Ad Unit will be used on, from the drop down menu.
  • A field called “Website URL” will appear and you should select the relevant URL from the drop down menu.
  • Under Placements, the “Stream” item will be selected by default.
  • Scroll down to “Ad Details” section and “Advanced Options”
https://s.yimg.com/oo/cms/products/flurry-docs/publisher/images/manual_ad_creation_flurry_98dbd5b5f.png

From here you can either proceed by Manually Creating and Ad Template using your own code or one of our templates, or you can proceed to use our Ad Builder tool to automatically create an ad template.

Manually creating an Ad Template

  • Enter values for “Show first ad at position”, “Every this number of articles” and “Show this number of ads”:
Value Description
Show first ad at position

The starting position for ads in the content stream.

For in-article positions or pages where XPath positioning will not be used set this value to: 99

Every this number of articles

The number of items between each ad placement. For example if you want an ad every 3 stream items, set this value to 3.

For in-article positions or pages where XPath positioning will not be used set this value to: 99

Show this number of ads The total number of ads to be shown.
  • Expand the Advanced Options by clicking on the title
  • Set Image Width and Image Height values for the Ad Image.
  • For responsive designs you can leave these values as 0 Flurry will apply “width: 100%;” and “height: auto;” as the values.
  • Enter a valid XPath expression to set the stream; For positions where a reliable XPath cannot be found, use XPath: /html/body/a/a/a/a/a
  • Paste your HTML ad template into the “Template” text area.
  • We also have a number of example ad templates available you can use.
  • Click “Submit” to save the Ad Unit
  • If you are hardcoding your ad tag you can now retrieve this from the top of the page by clicking on “View Ad Tag”. Learn more about handling ad tags here.

Note: Allow 1 hour for the ad unit to become active.

Setting Ad Placement

Ads in Content Streams (XPath)

Native ads serving primarily relies on XPath and the “Show first ad at position” value to define the placement of the ads.

Using Ad Builder to set XPath

Ad Builder will automatically select the XPath of the content stream you selected during the ad unit creation. Try to select the first item in the stream, and amend the “Show first ad at position” value to set where in the stream the first ad should be shown.

Updating XPath

If you need to update or make amendments to the XPath you can amend the details via the Ad Unit Settings found at: Monetization > Websites & Ad Units > Website Name > Ad Unit Name

XPath Examples and Resources

Most modern browser-based developer tools will allow you to copy the XPath from your browser’s developer tools via right-click on the selected source element.

If you are familiar with XPath you can construct your own XPath with some basic expressions.

For example:

Example XPath Expression Description
//*[@id=”id-name”] selects the element where id=”id-name”
//*[@id=”id-name”]/ul/li Selects the <li> children of <ul> elements belonging to an element where id=”id-name”
div[contains(@class, “class-name”)]

//*[@id=”id-name”]/ul/li

finds all <div> tags containing class names containing the text “class-name” Selects the <li> children of <ul> elements belonging to an element where id=”id-name”
div[contains(@class, “class-name”)]

finds all <div> tags containing class names containing the text “class-name”

If using with class names be very specific because, for example, if you use [contains(@class, “site”)] there may be multiple elements with classnames like: site-header, site-wrapper, site-footer etc.

Replace Ads

Replace Ads gives you an option to control the placement of Ads by using a container on the page. Replace Ads are set up using AdBuilder or by hardcoding First Ad at position and Every this number of articles option in the Ad Unit Page to 99. This can be achieved by AdBuilder

Article pages and Ads not in Stream Placements

If the ad will be placed outside of a stream (e.g. mid-Article) or you cannot locate a reliable XPath to use for the ad placement you can insert the ad using the “Replace” or

tag method. This enables ads to be inserted where this
tag is placed:

<div class=”yap-ad-{adUnitCode}”></div>

To enable this from the Edit Ad Unit page, set the parameters listed in the ad unit template to these values:

  • Show first ad at position: 99
  • Every this number of articles: 99
  • And show this number of ads: 1 [should equal the number of ads you want to show]
  • XPath: /html/body/a/a/a/a/a

Click “Save”

The Changes will take approximately 1 hour to become active.

As you will need to also place a <div> tag on the page for the ad to show, you need to obtain the adUnitCode to be used in the <div> tag.

You can find this in:

Monetization > Websites & adunits > Site Name > Ad Tag Name > View Ad Tag

The adUnitCode you need is the long string of letters and numbers separated by hyphens.

In the example ad tags below, the section code/ad unit code is: 9189eb82-100d-4d26-b869-cee9e12e3b86

So the <div> tag needed to be added to the page, would be:

<div class=”yap-ad-9189eb82-100d-4d26-b869-cee9e12e3b86”></div>

Flurry Ad Tag:

<script type="text/javascript">
 var w_yahoo = (top == self) ? window : window.top, d_yahoo = w_yahoo.document;
 w_yahoo.adUnitCode = w_yahoo.adUnitCode || [];
 w_yahoo.adUnitCode.push("9f6d1adc-55a8-4b13-9c8d-d91fb465d984");
 w_yahoo.apiKey = "JSFP58RN469KXFC28PJR";

 (function () {
   var script = d_yahoo.createElement("script");
   script.async = true;
   script.src = "https://s.yimg.com/av/yap/ga/yap.js";
   d_yahoo.body.appendChild(script);
 })();
</script>

Showing multiple ads

Showing multiple ads with the “Replace” method is simple. Firstly check the value of “show this number of ads” matches the number of ads you want to display.

Next, simply place the same <div> tag exactly where you want the ads to display.

So for example, If you want 3 ads shown, you would place <div class=”yap-ad-{adUnitCode}”></div> 3 times on the page.