Showing posts with label Mobile. Show all posts
Showing posts with label Mobile. 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

How to turn on a mobile theme / template for blogs in Blogger

This article explains why mobile mattes for some blogs (but not all), what tools Blogger has provided to help with this, and how to set up a mobile theme (aka template) for your blog.  It also links to Google's mobile testing tool, which shows you how your blog looks on a mobile device.



By default, when someone uses a smartphone, tablet or other mobile device to look at your blog, they see the "full site" just like they would if they were using a PC.   The pages aren't set up to work well on their small screen, but they have access to all the features and gadgets you've installed.

In some cases, this is fine.  For example, when I first wrote this article, I looked at the statistics for this site and hardly any of the visitors were mobile.   However now, a couple of years later things have changed and I've implemented a mobile theme for this blog.

But for other blogs, especially ones that have maps and other location-information or which people read on the go, having a mobile-friendly theme is very important:   for example, on my public-transport blog, over 25% of visitors are using mobile, and that figure is growing.  Making my site work well for these visitors is definitely important for its long-term future (and my short term advertising revenue!)


What's available

Blogger have made a set of mobile themes, to match the standard Designer Themes, and so far only one to match the Dynamic theme(s).

We cannot control the layout of gadgets on these - when the screen is only 300-ish pixels wide, there's not much room to move.

But we can add and remove gadgets, and also by choosing a custom template get colour settings that match our main blog.


How to enable a mobile theme / template for your blog

Log in to Blogger using an account with administrator rights to the blog.

Go to the Themes tab.

If your blog has a Designer or Dynamic theme, then there will be a Mobile option to the right of the "Live on Blog" area.



If the blog is not set up to use a mobile theme ,then the word Disabled will be in the middle of the picture area - although it may be hard to read if your base template (chosen in the Live on Blog area) has a picture behind it.

Click on the gear-wheel underneath the picture to see the mobile options.

Select "Yes.  Show mobile template on mobile devices."



Either leave the mobile template on Default, or select one of the other options.
  • If you choose Default, your mobile template will use the standard template matching your desktop template.
  • If you choose Custom, your mobile template will use the colour-scheme and various features from your desktop template, and you will be able to makes changes to these settings.

Use the Preview button if you want to see what your blog will look like with the selected template on a mobile device.

When you are happy with your selection, press Save.


What your readers see

Visitors to your blog who are using a desktop PC (or laptop or netbook or any other machine with a full-size screen) won't see anything different.

Readers who are using an internet-enabled cellphone (ie smartphone), tablet, iPad, etc will see a different view:
  • They won't have a sidebar
  • The gadgets will be limited (unless you add some extra ones) and in the header and footer only
  • On the home-page there will just be the title, thumbnail and snippet for each post, and a button for read-more (this is irrespective of where you've put the jump-break) - notice that the usual methods of giving your blog a home-page don't always work.
  • Custom styles that you have added to the template may not be applied (this has happened on one blog where I use styles, I'm still investigating whether it's a feature of all mobile templates, or just due to the way I added these particular styles).
  • There will be buttons at the bottom of the page for Home, <   and > .    I think that the latter two refer to older and newer posts (though possible they are the opposite way around from what I expect).
  • There will be a link to "view web version", which lets your visitor switch to to see the blog using the desktop template.

I have a  feeling that there may be some other differences too - very keen to hear about any others you've spotted.


Seeing what your mobile readers see

The absolute best way that I've found to accurately experience my blogs as mobile visitors see them is to use a mobile device myself:
  • Just like preview mode in the Post-editor, the mobile preview mode shows a "look and feel" view, which is not entirely accurate.   For example in the picture above, it shows part of the most-recent article insteaod of just the post title and mini-snippet that I see when I look at the site on my phone.
  • The screen-size testers that I've tried out (ie software tools that mimic showing your website in various different screen sizes) don't actually use the mobile template - I suspect that this is due to the way that Blogger detects mobile devices.

However you can see any blog as it would be on a mobile device by appending /?m=1 to the end of the URL.    For example, to see this blog in mobile, I would look at http://areyoublogger.blogspot.com/?m=1      If you're going to use this approach, it's best to re-size your browser window so that it's about 300px wide - from my netbook, that's about 1/3 of the screen size, but it would be less from machiens with bigger screens.


Another approach is to use Google's Mobile Friendly Testing tool, which will
... analyze a URL and report if the page has a mobile-friendly design.
As well as showing you how your blog looks, it also reports on any issues that have been found.






Related Articles

Adding gadgets to your mobile template.

Removing the attribution from moblile blogs

Showing a Google custom map on your blog

Advertising programmes for websites

Types of Blogger template

Administrator rights to your blog

How to copy and paste a website address on an Android smartphone

This article explains how to copy and paste a website address (URL) when you are using the Chrome browser on an Android smartphone.



Copy and paste on an Android phone

When you are using an Android cellphone, the usual way to copy-and-paste text is to "long-click" on one word, and after it is selected, drag the selector-bars at either end to select more of the text.

After this, you have options on a list at the very top of the screen to cut, copy and page.

But this doesn't work on the Chrome browser's address-bar, ie the place where you type in website addresses, or see the address which your currently viewed pages has.

Here, there is no long-click, and you have to use a slightly different approach.


How to copy a web-address on a Smartphone using Google Android and Chrome


1 Inside Chrome, go to the website and page that you want to copy the address from.


2 From the top right handcorner, choose the Overflow menu button: this is three vertical dots.


3 From the menu that opens, choose Share


4 choose Copy to clipboard from the list of sharing options.


Step 1: Choose Share

Step 2: copy-to-clipboard
Now, when you go into other applications and pages, you can long-press, and a small PASTE button will appear.   Click this - and watch your copied link get pasted.


Troubleshooting

Remember that if it's a Blogger site that the link came from, you may need to remove the " /?m=1" from the end of the URL, for the sake of non-mobile users of the place where you are pasting the link.


How exactly is this a Blogger tip?

Fair question - this a blog about using Blogger, Google's website tool for the rest of us, not about Android phones!   But as more and more people are using mobiles, and so mobile-friendly themes become ever-more important) I still think it's relevant - here's why:

Even with a new phone running a very recent version of the Android operating system, I still find it too hard to write anything exepct the simplest posts on the phone.

But I've found that I can do more and more of the promotional and social-media aspects of managing my blogs on the phone in my "spare mintues", eg while I'm on a bus, or sitting in a waiting room. Very often, this involves locating a blog-post which answers a question, and posting a short summary and link to the post there. An of course to do this, I need to copy the link to the post. So copy-and-pasting website URLs is now one of the tasks need to do fairly often.




Related Articles

Making a social media / communications plan for your blog

Turning off Blogger's mobile theme

AdSense, mobile templates and Analytics - and how they do (or don't) work together


If you

then it's an extremely good idea to have at least one AdSense ad-unit that was made with Blogger's official AdSense widget rather than by getting the code from AdSense and installing it manually.



This is because the a majority of gadgets don't show up on the screen when a visitor using a mobile device (cellphone or tablet) looks at a blog which has a mobile template set up for it - and by default this includes AdSense gadgets.   When a mobile visitor looks at a blog, Blogger does check to see if AdSense is used on it, and if so it shows one or two ad-units to them.  But unfortunately these checks only detect AdSense gadgets, not AdSense code in HTML/Javascript gadgets or added directly to the template.   So the net effect is that unless you have one of the official AdSense gadgets, mobile visitors to your blog will not see any AdSense ads.

Some more things to note

There is a way to explicitly say that certain gadgets should be shown on your blog when it's viewed in mobile.    However I've found that due to a problem in Blogger, if you use this method, you will get an error message every time you try to manually edit your template.

Also, because of the limits to the number of AdSnese ads you can show, it seems logical that the one official AdSense gadget on your blog should be a link unit - specially since AdSense earnings through Blogger gadgets are not reported in Analytics even if it is properly set up for your blog.   However at the moment, if you try to add a link-unit to a Blogger-site, then you get an error message like this:


"Please correct the errors on this form"
The error message when you try to add an AdSense Link unit in Blogger

This only appears when a link-unit has been selected, and I have not been able to find any way to work around this problem when adding a link-unit of any size.


Why enabling a mobile template just became more important to some bloggers

This QuickTip explains some recent announcements from Google  about SEO and mobile devices, and what they mean for Blogger users.


quick-tips logo

If SEO matters for your blog, and your blog is relevant for users with moble devices, then you pretty much need to enable a mobile template.

Why?   In short, because this recent post from Webmaster Central says that for Google the ranking of search results on mobile devices is now impacted by how well sites are optimized for mobile devices.

This means that if you haven't set up your blog for mobile, then it won't come up so highly in the search results seen by mobile users.

As well as the template, there are a range of other factors that affect how well your site works for mobile. Blogger users cannot control a lot of them, though we can think about:

Also, remember that if you make a home-page using a custom re-direct, this will only work in your desktop version. The re-direct isn't applied for mobile viewers, they just see your most recent posts in mobile-friendly tiles.

Blog home-pages and mobile-templates: Do they work together?

This article discusses the issues of giving your blog a home page, and how this works for people using mobile devices.



Previously I've described the options for giving your blog a "home page", and also how and why to enable a mobile template for your blog.

The home page (aka landing page) issue was a challenge with no good solution for a long time - until someone cleverer than me spotted the potential offered by the custom-redirect feature.   With this, you can put the content for a "home page" into a post or page, and then redirect your blog's "landing page URL" (www.yourBlog.blogspot.com) to it.


However, I have found that if you have enabled a mobile template for your blog, then this approach does not work for visitors using mobile devices.

Instead of the home page that non-mobile visitors see, mobile-using visitors are shown a mobile-specific page with:
  • Your header,
  • The page gadget (if you've used one - it's not used in this example) as a drop-down list
  • A list of tiles - one post each (more about these below)
  • An older posts / home / newer posts navigation tool
  • A link to view the web-version
  • A mobile attribution gadget (unless you've removed it)
  • An AdSense ad-unit, if you have put AdSense into your blog using the AdSense gadget(*).


There may be some different things too, if you have chosen the "custom" mobile template option and added other gadgets to be shown on mobile.

But a key point is that any home-page custom-redirect that you have set up does not work - even though other custom-redirects (ie not involving your home page) do work.



(*) The rules for whether this is shown or not are actually a little more complex - but that's a topic for another day!


What do mobile users see on their post-tiles.

The landing page for a mobile user includes a vertical "tiled" list of posts.

 In this, each tile has:
  • The date and post title,
  • The post-thumbnail photo and
  • The first few words for the post (less than the whole snippet though) for a post.

They are sorted by descending-date - meaning that your most recent post is at the top of the list.

The applies if  you are using a standard (ie designer) or custom mobile template.

The recently-introduced dynamic mobile template is different again - in it, the tiled post looks more like the "before the jump" summary shown on your regular blog - but even so, it is still a list of posts sorted in reverse-date order, not a custom home-page.


What this means for bloggers who care about their home page

There are main things that you need to think about:
  • Using a mobile template gives you far less control over your mobile landing page - although it can be set up to work well if you understand how it operates, and if you don't mind your blog looking like a blog, not a webpage..
  • With a non-dynamic mobile template enabled, visitors won't see whole posts or before the jump post-summaries initially: instead they see even more abbreviated summary tiles.
  • With a dynamic mobile template enabled, visitors will see post-tiles that are more like the post-summary from the main blog (even if it's using a non-dynamic template) - but they still won't see your custom landing page.

If you are not happy with mobile visitors to your blog being shown a tiled-list of posts, then you should not enable a mobile template - and you should disable it if you've already enabled one

This will mean that people using a mobile device to look at your blog will see a full-featured version, that they will most likely have to scroll around to view, ie they won't see the whole screen at one glance.   Though this sounds painful, in two of my blogs, I've decided that this is actually the best approach.




Related Articles:

Enabling a mobile template for Blogger

Deleting "Powered by Blogger" from mobile-template blogs

Making one post always come up first

How to give your blog a fixed landing page

Understanding post.thumbnail and post.snippet

Using Blogger to build a "real" website