Showing posts with label Advertising. Show all posts
Showing posts with label Advertising. Show all posts

How to set up Page-level AdSense ads in your blog

This article describes Page-level ads, a new type of AdSense advertisement which Google has recently introduced.   It includes how to set up these ads if you use Blogger, and some troubleshooting information about them.  

It also describes how to fix an error in the code which is supplied, which causes a message like "Attribute name "async" associated with an element type "script" must be followed by the ' = ' character".



What are Page Level AdSense ads

Google has recently introduced a new type of Adsense ad-units, which may be shown to people who visit a website using a mobile device (eg smartphone of tablet),

There are two types of Page-level ads:
  • Vignette ads:   When a visitor on your site clicks on a link to another page on you site, a vignette ad may be loaded as a full-page overlay which the user needs to close before they see the page which they navigated to.
  • Overlay ads:   these are smaller ads which show at the top or bottom of your screen, and which "stick" to the edge, so they seem to stay in place as the user scrolls up and down your site.   The visit may click on them in the usual way.

For Blogger users, these ads are only currently available if you have a full AdSense account: if you only have a hosted AdSense account, then you cannot get the code to install them.   But if you do have a full AdSense account (either because you have a custom domain, or because you signed up for AdSense before the "host AdSense account" option was introduced), they are attractive because they don't count towards the count of advertisement-units which you are allowed to display on each page.

They also only work if you have a mobile template switched on for your blog, so that visitors who use a mobile device see mobile-optimised screen.


How to install AdSense Page Level ads in Blogger

Log in to your AdSense account.

Go to the My Ads tab

Turn on one or both of  Overlay or Vignette ads options.
(By default, they are both turned Off.    Click on the empty box beside the "0" to turn an option to  on:  in these controls, 0 means "off" and 1 means "on".)




Click the < > Get Code button.

Copy the code that is generated.

Switch to Blogger, and edit your template in the usual way.

Find the text   <head>    (including the brackets).

On the very next line after <head>, paste in your code.

Optional - but highly recommended - add comments to clearly show what this code is for.   I usually use
<!-- START ADSENSE PAGE LEVEL ADS -->
and then the code goes in here ...
<!-- END ADSENSE PAGE LEVEL ADS -->
Preview the template, and make sure it's working.
(See Troubleshooting section below if you get a message about   Attribute name "async" associated with an element type "script"    or similar.

Save the template.



Job done!   This is all you need to do to enable page-levels ads for your blog:   you do not need to install gadgets to say where these ads go, because Google handles this for you.


How to see what page-level ads look like in your blog

Visit your blog using a smartphone or tablet.

Add the text   #googleads   at the end of the website address, so it changes from something like:
http://areyoublogger.blogspot.com/?m=1
to something like:
http://areyoublogger.blogspot.com/?m=1#googleads

After this, when you click on a link to move a different page in your blog,  a Vignette style ad will display - these are whole-page ads, which include a "close ad" button, like this:



Troubleshooting

Extra "src" text in the ad-code

Right now, there is a problem with the code that AdSense are providing.   I don't know if this is because Blogger doesn't understand a feature that AdSense is using, or if it's a genuine bug.    But if you see a message like this when you try to preview the template:
Could not load template preview: Error parsing XML, line 21, column 15: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.
then there's a very simple change that you have to make.

All you have to do is delete the "src" immediately after the word async.

So your code changes from like this:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-DONT-USE-MY-NUMBER-GET-YOUR-OWN-PUBLISHER-ID",
    enable_page_level_ads: true
  });
</script>

to like this:
<script async ="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-DONT-USE-MY-NUMBER-GET-YOUR-OWN-PUBLISHER-ID",
    enable_page_level_ads: true
  });
</script>

Different Page Level settings for different websites

If you are using Adsense across several different websites, then you may want to enable one of vignette or overlay ads on some sites, and a different option on others.

Currently, there is no way to do this:  you must choose one combination of:
  • No Page Level ads
  • Overlay ads only, no Vignette ads
  • No Overlay ads, but do show Vignette ads
  • Allowing Google to choose Overlay and/or Vignette ads

Stop Vignette ads being attached to some links

By default, any link to another page in your blog may have a Vignette ad attached to it.    However there may be some links which you specifically don't want this to happen to - for example if the user really needs to remember what was on the current page once the get to the next one.

You can prevent any Vignette ads being displayed when a user clicks a link by adding a tag to the link.

The tag to add is:
data-google-vignette=”false”

and you need to switch to Edit HTML (top left of the post-editor window) to add it.

This is an example link to another page on this blog which is prevented from having a Vignette ad, and this is the HTML code I've used to achieve this.
<a data-google-vignette=”false” href="http://areyoublogger.blogspot.com/2010/02/stop-malicious-use-of-your-adsense.html">an example link</a> 

More help

Google have provided more information about Page level ads here.



Related Articles

Setting up a mobile template for your blog

Editing your Blogger template

Hosted AdSesne accounts for Blogger users

Advertising & Blogger: things to consider

This article discusses some things to keep in mind when you are putting advertising on your blog.


If you are considering putting advertising onto your blog, there are some basic things that you need to think about.  These include broader philosophical questions, right down to nuts-and-bolts technical concerns.

This article is not a definitive guide - see somewhere like ProBlogger for that.   Rather it's a collections of thoughts about the issues specifically related to Google's Blogger and its relationship with advertisers.   And it may include some thoughts about philosophical and policy issues, if I do any deep research or thinkng about these in the future.


Terms and Conditions

There are lots and lots of possible advertising and affiliate marketing programmes.

Staying within the programme of terms and conditions (often called T&C's) for every programme that you participate in is important.   Every advertising programme has terms and conditions.   You need to find the ones that apply to the programme(s) you are considering.  Read them.  Remember them.  Follow them.   Keep up-to-date.

Also, keep an eye on Blogger's T&C's and content policy too, in case they have any impact on what advertising you are allowed to carry.


Advert Co-location

Not every type of advertising can be shown on the same web-page as every other type of advertising.  See the point about about terms-and-conditions.   And besides - you need some space on your blog for content, which is what keeps advertisement-viewers coming to you in the first place!

Blogger doesn't have any automatic support for conditionally showing advertising.  If any programme you have has constraints like this, then you may need to do some programming in order to use that programme.


Placing ads

If you want to use advertising that isn't integrated with Blogger through the Monetize tab, then you're going to have to place blocks of HTML code into gadgets or into pages.

You don't have to write the code (the advertising network does that), or change it.  You just have to copy and paste it, and put the HTML into your blog, wherever you want the advertising to do.   (Note:  HTML and Javascript are the only types of code you can use.   No SQL.   No php.)

If you're not comfortable-enough doing this with the Blogger template that you have, then stick to the Blogger-endorsed programmes that can be added through the Monetize tab.


Experiment, and Track Progress

Marketing is an art and science.   So can use scientific techniques for data gathering.   Experiment with altrnative ad-placement.   Maybe even create a 2nd non-public blog where you can test how things look when you set up ads (and other gadgets, for that matter).  Only put them into your real blog when you're happy with how they work.   Once your ad is live, track your progress.

To effectively track progress, you need to keep a list of the date when you made changes to your site, and then do regular data-analysis to see what effect these changes have on your number of visitors, and their behaviour.    This is tedious - but if you really want to know what works and what doesn't, it needs to be done.


Watch your ad-contents

Make sure you know what types of things the programme you have chosen is advertising.  With Blogger, you (we!) are getting web-hosting for "free" (we have to watch their ads), and domain registration very cheaply.   Make sure that the advertising you use doesn't cause you to violate Blogger's terms and conditions.  I'm thinking especially about Adult/Pornographic content here, but I guess it could apply to other things too.

If you are using AdSense, it's pretty much essential to manage the categories of ads that AdSense displays.



How will you get paid

Some advertising programmes are very easy to be part of:  they give you ad, and pay you regularly.   Other's are more difficult.   Worst case, you may find that some options are totally unuseable for you, because they cannot make payments in your contry.   Or the cost of getting paid is extremely high - ProBlogger has written before about the transaction time and cost of every payment he receives from Amazon.com.



Related Articles



Managing the categories of ads that AdSense displays.

Putting HTML from advertisers into your blog

A short list of advertising and affiliate marketing programmes