Building custom analytics solutions based on Piwik, an open source
analytics platform.
By Maciej Zawadziński
20/08/14 [email protected] 1
BrightTalk, 20/08/2014
Table of contents • Introduction • What is Piwik?
• Customising Piwik
• Q&A
20/08/14 [email protected] 2
INTRODUCTION Custom analytics solutions
20/08/14 [email protected] 3
About me • Maciej Zawadziński, • Joined Piwik in 2008, • Technical background
in analytics and adtech, • Enterprise-level and
Cloud services, • CEO of Piwik PRO, the
official Piwik company. 20/08/14 [email protected] 4
Why analytics is important? • Collect the usage data, • Understand users’ behavior,
• Measure the performance (of apps, marketing channels etc.),
20/08/14 [email protected] 5
Why analytics is important? Ultimate goal: make data-driven decisions. • Improve navigation and usability, • Increase engagement, • Increase conversions/sales, • Improve marketing budget allocation, • …
20/08/14 [email protected] 6
WHAT IS PIWIK? Custom analytics solutions
20/08/14 [email protected] 7
Piwik in a nutshell • The leading open source analytics
platform, • Used on 1.1M+ public websites,
• Translated into 53 languages,
• Free/Libre software,
20/08/14 [email protected] 8
How Piwik is different? • Control over the data • Raw data access, no sampling, • Privacy compliance, • User- and Session-level reporting, • OSS (Open Source Software) transparency, • Vendor-independent, • Extensible & customisable.
20/08/14 [email protected] 9
What can I use Piwik for? • Website analytics, • Ecommerce analytics, • Intranet analytics, • Mobile app analytics, • Web server log analytics,
… and many more!
20/08/14 [email protected] 10
Who use Piwik? • 1.3% of all public websites, – 16% of the .de domains, – 11% of the .gov domains,
• Enterprise-level clients including: – International corporations, – Governments, – Banks.
20/08/14 [email protected] 11
Why Piwik? • Tighter privacy laws, • Keeping sensitive data in-house, • Customise to specific needs: – Customise behavior of the platform, – Add new or override existing functionality, – Integrate with your apps, CRM, date
warehouse or other systems. 20/08/14 [email protected] 12
CUSTOMISING PIWIK Custom analytics solutions
20/08/14 [email protected] 13
Piwik is a platform • More than 200 configurable variables, • Custom data tracking,
• Plugins & themes,
• APIs,
• Integrations.
20/08/14 [email protected] 14
Configurable variables • Piwik superadmin
settings,
• Basic platform settings.
20/08/14 [email protected] 15
Configurable variables • Advanced
configuration settings – config/config.ini.php
• All settings with default values can be found in – config/global.ini.php
• DO NOT edit global.ini.php directly.
20/08/14 [email protected] 16
Configurable variables Examples: • Branding settings, • Data refresh time, • Cookie settings, • Proxy headers for IP address lookup, • Session length, • Report/API settings.
20/08/14 [email protected] 17
Custom data tracking • Page (Action) level custom variables, • Visit (Session) level custom variables,
• Events,
• JSON data.
20/08/14 [email protected] 18
Page-level custom variables JS: _paq.push(['setCustomVariable',!
!1, // index!!"Type", //name!
"Article", // value! "page" // scope!]);!
20/08/14 [email protected] 19
Page-level custom variables Example use cases: • Type of the page or content (e.g. Article), • Section of the website (e.g. Clothing), • Actions on the page (e.g. clicked ‘Like’), • Alternative name of the page, • Unique ID of the page,
20/08/14 [email protected] 20
Visit-level custom variables JS: _paq.push(['setCustomVariable',!
!1, // index!!"UserType", //name!
"Anonymous", // value! ”visit" // scope!]);!
20/08/14 [email protected] 21
Visit-level custom variables Example use cases: • User ID – username, email, unique id, • User attributes – age, gender, group, membership
type etc., • Visit/Visitor classification (e.g. First-time,
Customer, Frequent Buyer), • Site variant/Domain entry page, • App/Device attributes (e.g. App version, locale,
number of app launches etc.), 20/08/14 [email protected] 22
Events JS: _paq.push(['trackEvent',!
!"Videos", // category!!"Pause", // action!
"The Shining", // name! 210 // value!]);!
20/08/14 [email protected] 23
Events Example use cases: • Content engagement and interaction, – Audio, video, maps, articles, galleries, games etc.
• Site errors (e.g. JS errors),
• Custom actions (calls, device swipes etc.),
• Ads clicks/displays.
20/08/14 [email protected] 24
JSON data JS: _paq.push(['setCustomData',{ "items" : [ ! "1",! "2",! "3"! ] !}!
]);!
20/08/14 [email protected] 25
• JSON custom data is not saved by Piwik,
• Data can be used and stored by Custom plugins.
Marketplace • plugins.piwik.org, • 24 plugins available, • One-click installation
from Piwik UI, • Anyone can publish a
plugin.
20/08/14 [email protected] 27
Custom plugins • Developer portal (developer.piwik.org): – Guides, – Documentation, – API references, – Changelog.
• Development tools ./console development:enable --full!
20/08/14 [email protected] 28
Custom plugins Example use cases: • Changing tracker’s behavior, • Additional data tracking, • Custom reports, • Adding new visualizations, • Auth/Login, • APIs, • Scheduled Tasks.
20/08/14 [email protected] 29
Custom themes • Create a theme plugin developer.piwik.org/guides/theming
• You can: – Override CSS, – Override Twig templates,
– Add JavaScript files.
20/08/14 [email protected] 30
Custom themes Example use cases: • White labeling Piwik,
• Embedding Piwik into existing apps.
20/08/14 [email protected] 31
APIs • Analytics API – Reporting API – CRUD API – Metadata API
• Tracking API – Record data in Piwik, – JavaScript, REST API & libraries.
20/08/14 [email protected] 32
Analytics API • Used to request all Piwik reports and to
manage websites, users, permissions, email reports, etc.
20/08/14 [email protected] 33
Analytics API Example: index.php?module=API&!method=VisitsSummary.get&!idSite=7&!period=day&!date=2013-05-19&!format=xml&!token_auth=anonymous!
20/08/14 [email protected] 34
Analytics API Important parameters: • Data formats – xml/json/tsv/csv/html/php
• Period/date – specify the timespan for report,
• Site id • Token auth 20/08/14 [email protected] 35
Tracking API • JavaScript API, • REST API, – Java/PHP/Python/Objective-C classes
available,
– Bulk tracking
20/08/14 [email protected] 36
Tracking API Example use cases: • Tag tracking,
• App tracking,
• Server-to-server tracking (e.g. reliable conversion tracking).
20/08/14 [email protected] 37