As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label tracking. Show all posts

I was wandering around the settings section and found out I can not only turn off sharing on Google+ but also have Google Analytics support from Blogger. I recall I had read it long time ago on Blogger Buzz.

I want it because the pageviews from View will be also tracked. I can not touch the code of View, so this option is very helpful if I want to have complete tracking statistics. I have put View link on top of navigation bar for really long time and I probably lost some data.

I wrote my own Layout template, so it won't work by default in my own layout. It is actually very simple to have it, add the following line before </body>, e.g.
  <b:include data='blog' name='google-analytics'/>
</body>

I also removed the tracking code from my main JavaScript script, so I wouldn't have duplicate data.

This is probably the second of third time I use View mode on Blogger, not only on my blog but entire Blogger blogs. I don't really like View, it looks good and nice, but I am just not a fan of it.

Maybe because it create unique style over different blogs. I like variety, diversity of styles or layouts or designs. Pretty or ugly, doesn't matter. The important thing is the style of the blog's owner. With View, it doesn't reveal of that much.

Since I hardly check the View of my blog. I just realize there are two ads units. One at right side, the other at bottom. I roughly check with FireBug Net tab, I think they are belong to me, my Google AdSense Publisher ID, I believe. (It's long ID, but looks like mine)

As you may know, I put two ad units in my template, so I don't object for the such convenience. Just I don't see any setting options I can adjust size or location for my View. So it probably also a unique setting all over the views, I guess.

I had this idea in the end of September 2010 when I was playing with Google Analytics' tracking code. I wrote some code for rating blog posts using the option value, the code did stay on my blog for a day or two before I took it down, it wasn't too useful for me. But a function allows visitor to report page issue could be very helpful if someone is willing to click on some buttons.

I have finished a simple code and it's at bottom of this blog:


Well, it doesn't look pretty. Here is the code in that HTML/JavaScript gadget:

<script src="https://gist.github.com/raw/1713067/ga-wr.js"></script>
<script>
function init_page() {
  var gawr_options = {
    target: 'ga-wr',
    UA: 'UA-XXXXXXXX-X',
    report_options: [
      {
        title: 'Image is not loaded'
      },
      {
        title: 'Link is broken'
      },
      {
        title: 'Other'
      }
      ]
    };
  new GAWR(gawr_options);
}
$(init_page);
</script>
<div id="ga-wr"></div>

For report of issues report, I can write my own program to get daily report using my current daily report as base. But I don't think I will trouble myself, not yet anyway. Right now, I can see the report with custom report in Google Analytics:


It works great for me for now. Note that, you need to use Alert/Total Events instead of Pageviews. It's event not page. The report does get updated very quick, probably a few minutes after reported. I will say that's instant almost.

Now a little technical background of this script. Basically, you should use different profile. It will track page when a report is being submit and the report is recorded as Event. Event action is the issue name and option label is the additional information as you seen in the image above.

Option value can only accept integer, custom value probably can do the trick, but I put the data in option label. There is another way to record is to rewrite the page URL when tracking the page, but I don't like that. But this could be a benefit, rewriting url to be /original-page-url/issue and still send the event. This way, if you watch Real-time tab, you can see there is a report just comes in if you don't use separate profile.

And remember when visitor reports, page URL is recorded by page tracking, also user's browser and system and everything Google Analytics collects by default is already in the data. Isn't this awesome and brilliant? I don't even need to code for collecting such data if I need to check visitor's browser, they are just there for me to read.

Google Analytics API can do more than just website access statistics, you can set up a poll or some thing more. Imagine you let people to vote and you use visitors metric or something to prevent some degree of voting spam.

Only the data isn't public without coding and they require process.

By request of westius, BRPS now is able to append a small piece that may help your track if your visitor click on posts of related posts list.

The new option is append_src:
<script type="text/javascript">
window.brps_options = {
"append_src": true
}
</script>

The the links in related posts list will look like
http://example.blogspot.com/2009/03/post-title.html?src=brps