Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to extract the book URL from a link using Microdata. The format is specified in Schema.org.

Here is my HTML:

<div class="col-sm-4 col-md-3" itemscope itemtype="http://schema.org/Book">
                <div class="thumbnail">
                    <img src="{{ book.thumbnailurl }}" itemprop="thumbnailUrl" style="width: 100px;height: 200px;">
                    <div class="caption">
                        <h4><span itemprop="name">{{ book.name }}</span> - <span itemprop="author">{{ book.author }}</span></h4>
                        <p><span itemprop="about"> {{ book.about }}</span></p>

                                <a href="{{ book.url }}" itemprop="url" onclick="trackOutboundLink(‘{{ book.name }}’);">
                                  <button type="button" class="btn btn-default btn-md">
                                    <span class="glyphicon glyphicon-book"></span>Read


When I use Google's snippet testing tool the JSON API returns book as an HTML link. However when I make the call in JavaScript the value of url is text("Read").

What am I missing?

share|improve this question
"However when I make the call in javascript the value of url is text("Read")." - Can you show us a code for this? BTW: It probably belongs to stackoverflow. – MarcinWolny Jun 13 '14 at 12:04

Ok finally after a lot of digging, I have the answer.

The root cause is as follows: The Google CSE(Custom Search Engine) is not consuming the microdata property value as the href attribute of the "a" HTML element. It is consuming the child text content on the "a" HTML element.

The Google CSE is able to consume the href from a "link" HTML element.


 <a href="{{ book.url }}" itemprop="url" onclick="trackOutboundLink(‘{{ book.name }}’);">

will not work.

 <link itemprop="url" href="{{ book.url }}">
 <a href="{{ book.url }}" onclick="trackOutboundLink(‘{{ book.name }}’);">


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.