Book Image

Piwik Web Analytics Essentials

By : Stephan A. Miller
Book Image

Piwik Web Analytics Essentials

By: Stephan A. Miller

Overview of this book

<p>Without web analytics, you are blind on the internet. In order to improve conversions and revenue on your web- site, you need to know what is going on. Piwik gives you this data and unlike Google Analytics, gives you total control over its usage. Unlike Google analytics where the data can be read by Google, Piwik maintains complete confidentiality of your website data. By harnessing the power of your tracked data, you can raise the conversion rates on your website to new heights.<br /><br />"Piwik Web Analytics Essentials" will show you how to install Piwik Open Source Analytics and have you tracking your website’s visitors within an hour after you pick up the book! After that, you will learn how to track custom events and programmatically trigger tracking events. The book continues with ecommerce tracking and advanced Piwik API usage.<br /><br />This book will take you from installing Piwik on your web server to writing custom tracking code for your apps.<br /><br />You will learn goal and event tracking techniques and how to add them to your standard tracking to fine tune your analytics results. Nothing is untrackable using Piwik: ecommerce shopping carts, web apps, phone apps, and more can make use of Piwik tracking capabilities.<br /><br />"Piwik Web Analytics Essentials" will walk you through every step with detailed screenshots and plenty of example code.</p>
Table of Contents (18 chapters)
Piwik Web Analytics Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Preface

Web analytics is a necessity if you have a website. More and more websites are being constructed. Small niches have hundreds of competing sites. And those sites that won't listen to what their traffic is telling them will soon disappear or be buried in the search results under sites that do pay attention to their traffic. And that is why anyone who has any type of website needs web analytics software such as Piwik to help them hear what their visitors are saying.

Web analytics began as simple log parsing to determine how many hits a website would get in a day, and has evolved into a complex science that can give you minute details on the people and bots that visit your site. And while there are many third-party, open source solutions for tracking and analyzing your web traffic, Piwik stands at the forefront as the open source alternative to Google analytics.

Unlike third-party solutions, Piwik gives you total control of your code, the server it runs on, and the privacy settings of your tracking. Piwik can be downloaded and installed on your server in five minutes for free and Piwik has the same advanced features as other third-party analytics services.

Piwik started in 2003 with a little web statistics program called phpMyVisites. At the time, it was one of the modern open source web statistics programs available. In 2007, phpMyVisites was replaced by the new and improved Piwik. Since then developers from all around the world have contributed to its constant improvement and have made it the advanced application it is today.

Piwik offers real-time reporting that allows you to track visitors from the instant they land on your website. Piwik also provides a dashboard interface that is customizable to the reports, charts, and date ranges you want. Piwik does this through the use of widgets that can be added and removed with the click of a button. Piwik protects your visitors' privacy with advanced privacy features that you control from a unified dashboard. Piwik handles multiple users and multiple websites out of the box and users can have access to one or many websites. Piwik can track e-commerce traffic, file downloads, 404 pages, RSS feeds, clicks on external websites, and internal site actions such as video interaction. Piwik's API makes it easy to integrate into any website CMS or backend CRM you may use, and that is only a few of the features that Piwik provides.

What this book covers

Chapter 1, Installation and Setup, shows you how to set up Piwik on your hosting environment. It will teach you the requirements for running Piwik and how to meet them if your server does not currently support them. It will also walk you through adding the default tracking code to your first website and configuring analytics for that site.

Chapter 2, Using Piwik's Interface and Reports, will teach you how to use and manipulate Piwik's dashboard and widgets. It will also show you how to customize online reports and the PDF and HTML e-mail reports. You will learn how to use the real-time analytics features of Piwik and how to filter and search your visitor logs to target specific data sets.

Chapter 3, Tracking Visitors with Piwik, gives details about using the default tracking code and goes beyond that and shows you how to configure cookies, how to set up tracking for downloads and outbound links, and how to use multiple trackers at once. By the end of the chapter, you will also be up-to-date on using asynchronous tracking in Piwik.

Chapter 4, Setting Up and Tracking Goals,defines goal conversion tracking and teaches you how to measure and reach goals for your website and business using Piwik's goal conversion tracking features. You will discover how to set up goals in Piwik and how to read and use goal overview reports and goal detail reports. This chapter will also show you how to set up revenue tracking.

Chapter 5, Tracking Marketing Campaigns, explains how to use Piwik to track visitors, conversions and revenue from paid ads, display ads, e-mail campaigns, and other sources. You will learn how to track with URL parameters, how to create campaign URLs, and how to track paid search ads and keywords.

Chapter 6, Tracking Events, teaches you how to record and track user interaction with website elements such as flash, videos, and widgets. You will find out why event tracking is important and how to set up your Piwik installation to track interactions with the Flash, AJAX, and JavaScript elements of your web pages.

Chapter 7, E-commerce Tracking, is devoted to those of you who own or run an online shopping cart and it will go through the details of tracking your ecommerce visitors, sales, conversions, bounce rates, and more. You will learn the difference between standard and e-commerce tracking and how to set Piwik up to handle your chosen monetary unit. By the end of the chapter, you will be able to track orders, items purchased, shopping cart actions, product page views, category page views, and be able to read the e-commerce reports like an expert.

Chapter 8, Piwik Website and User Administration, is all about multiple domains and multiple users. You will discover how to create new users or make your Piwik installation open for user registration. You will learn how to set user access levels and other advanced user management topics. You will also find out how to add multiple websites and subdomains to Piwik.

Chapter 9, Advanced Tracking and Development, will help you move beyond the JavaScript tracking features of Piwik and into more advanced methods of tracking visitors. By the end of this chapter, you will have learned how to use image tracking, how to use Piwik's tracking API, how to build a simple Piwik Plugin, and how to debug any tracking issues you may have.

Chapter 10, Piwik Integration, explains how to integrate Piwik into various CMS and CRM platforms, how to access Piwik when mobile, and the basics of using the Piwik Analytics API to create custom tracking applications. You will also learn how to embed Piwik widgets on other websites and how Piwik can be embedded in your own projects.

Appendix A, Tracking API Reference, is a minimal glossary of the Piwik Tracking API calls, which is handy for a quick reference when that API call just does not pop into your head, or for you to print out and use beside your computer.

Appendix B, Analytics API Reference, is a minimal glossary of the Piwik Rest API calls, handy for the same reasons as Appendix A, Tracking API Reference.

What you need for this book

You will need to have a server installed either locally on your computer or on a web hosting account. For most of you this will mean a LAMP stack of Apache, PHP, and MySQL, but the Apache server can be replaced with other servers such as Nginx or lighttpd if needed. PHP should be version 5.1.3 or higher and MySQL should be version 4.1 or higher. For some of the graphing capabilities of Piwik, you will need to have the PHP GD extension installed.

You will need FTP access and an FTP client if you are installing Piwik on a remote web server. If you are installing Piwik for learning purposes locally on your computer, you won't need to use FTP.

You can get 90 percent of what you need out of Piwik without knowing how to code. But that extra 10 percent can help a lot. JavaScript and PHP knowledge is helpful but any coding knowledge should suffice. Two chapters in the book are devoted to interacting with Piwik via code and code will be sprinkled throughout the book.

Who this book is for

This book is for anyone who wants an open source solution for web analytics. It is suitable for bloggers, website owners, JavaScript application developers, or analytics professionals. It will benefit those new to web analytics as well as experienced users and developers. And it will take you from installing Piwik to creating custom code to tweak Piwik data and integrate Piwik with your own projects.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "This function is the same as _trackPageview(opt_pageURL) in Google Analytics or submit() in Yahoo! Analytics".

A block of code is set as follows:

    [Tracker]
campaign_var_name="campaign"
campaign_keyword_var_name="keyword"

Any command-line input or output is written as follows:

chown -R www-data:www-data piwik

New terms and important words are shown in bold. Words that you see on the screen, in the menu or dialog boxes for example, appear in the text like this: "Navigate to the Campaigns menu in Piwik and check it out".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.