New Piwik Javascript Tracking API - How we designed it
There are a lot of changes in Piwik 0.4. Today, I'm going to write about the release of an exciting new version of piwik.js, Piwik's JavaScript tracker. While the improvements are all under the hood, Piwik's client-side code is now a heavyweight contender to the trackers from the "Big 3" (i.e., GA, Y!A, and MS).
Inspired by Remy Damour's code contribution, planning and redevelopment of piwik.js began over 9 months ago. Over this period, we continued to maintain the legacy piwik.js while developing this new and improved version. We looked at the APIs of the "Big 3". We heard your complaints. We read your suggestions. We tackled your support requests. And after many code reviews and test cycles, we believe it's time to unleash the code.
On behalf of the Piwik community, I'd like to thank everyone who submitted bug reports, suggestions, and input that drove this rewrite.
Highlights
The new piwik.js is:
- Object-oriented.
Multiple trackers on the same web page is now possible. And with the exception of legacy support, the code lives entirely in the Piwik namespace. - Backwards compatible.
You don't have to update the tracking code on your pages. Note: we have deprecated piwik_track(), piwik_log(), and global variables for configuration but backward compatibility will always remain. - XHTML-friendly.
The code no longer modifies the DOM. Specifically, the calls to document.write() — to attach the transparent 1×1 web bug image or to detect plugins in Internet Explorer — are history. - Less restrictive.
The code is more forgiving about where you insert the new tracking code in your pages. Also, custom data is now JSON stringified and no longer limited to a flat structure. - Industry-conforming.
The code now tracks the click event instead of mousedown. - More customizable.
Check out the API. For example, you can now define your own CSS classes for piwik_ignore, piwik_download, and piwik_link. - Heavily tested.
We added automated unit tests via QUnit. The code also passes JSLint and (Microsoft's) JavaScript Leak Detector.
Documentation
You can find the updated documentation for the revamped JavaScript tracking API here:
http://piwik.org/docs/javascript-tracking/
As always, we would appreciate your feedback. Thank you for using, supporting, and promoting Piwik.
This post is from Anthon Pang (aka "vipsoft"), new rockstar developer in the Piwik team.
This entry was posted on Tuesday, June 2nd, 2009 ; category Development, Documentation ; RSS comments.

June 8th, 2009 at 12:44 am
[...] ADDED new piwik.js Javascript Tracking API; More information in the blog post and the Javscript Tracking documentation #355 (by Anthon) - ADDED search engine links now link to [...]
June 8th, 2009 at 7:58 am
How do I catch non JS-Visitors? Are they not relevant anymore?
June 8th, 2009 at 10:48 am
Holy Dooly now this is going to be some fun too play with.
mmmmm the possibilities.
June 8th, 2009 at 1:49 pm
"Specifically, the calls to document.write() [...] are history."
Yippie!
June 9th, 2009 at 3:16 pm
congratulations! great work.
June 9th, 2009 at 3:53 pm
Great job guys, excellent!
June 9th, 2009 at 6:46 pm
wow… all stuff sounds great :-)
June 10th, 2009 at 3:11 pm
Well done, amazing work!
June 10th, 2009 at 11:17 pm
Awesome api!
June 13th, 2009 at 8:07 am
Great work!! i like it
June 15th, 2009 at 11:06 pm
wow…..i like it!!!
June 16th, 2009 at 4:16 pm
[...] the original post here: New Piwik Javascript Tracking API – How we designed it – Piwik Tags: about-the-release, form-, library, release-, search-entries, the-improvements, the-one, [...]
June 26th, 2009 at 1:03 pm
Thank you for reales New Piwik Javascript Tracking API. Well DONE
July 10th, 2009 at 11:05 am
Congratulations, nice !
July 20th, 2009 at 7:09 am
Thanks for the Tipp and helpfull inforation. BEST REGARDS from Tom, GERMANY
July 20th, 2009 at 6:54 pm
Very good work! You are Awesome api!
July 22nd, 2009 at 5:22 am
hi, what a great work, very helpfull for my, greetings from Germany
July 23rd, 2009 at 8:45 am
congratulations! great work. Thanks and have a nice day!
July 23rd, 2009 at 7:55 pm
fine post, Thanks from Kurti
my motto: Mountains never meet, people always
July 24th, 2009 at 3:58 pm
Thanks! great Work! Best Regards from Germany
August 3rd, 2009 at 5:08 am
Very good work!
Thank you.
August 11th, 2009 at 11:24 am
you have donne great job, just keep going, thanks
August 11th, 2009 at 7:23 pm
waiting so long for teh new java script
thank so lot
namensschilder
August 12th, 2009 at 1:16 pm
this java scrip was so cool it solved all the ideas i head…
August 12th, 2009 at 1:45 pm
you surprise me everytime with new scripts.
piwik make the world better
all wishes for future works
lanyards
August 18th, 2009 at 10:43 am
the new api runs well, but the database is getting biger and biger. how will you fix this in the future?!
August 18th, 2009 at 8:02 pm
Die Entwicklung von Piwik ist hervorragend. Seid ich Piwik nutze habe ich endlich den Durchblick wie ich ihn brauche.
Danke.
August 22nd, 2009 at 12:04 am
I like your site !
August 23rd, 2009 at 5:39 pm
congratulations! great piece of work. Thanks for this awesome tool and have a nice day! PIWIK is great.
August 23rd, 2009 at 5:42 pm
Hi Piwik Team, I use ure tool in my Shop and for me it`s the best way to track my customers. Thanks !
August 24th, 2009 at 6:24 pm
….absolute awesome api! Thanks for that cool piece of work.
August 28th, 2009 at 12:59 am
I will try it tomorrow! thank you!
August 29th, 2009 at 2:09 pm
thanks for this great work!
August 29th, 2009 at 2:12 pm
nice idea, thanks a lot, tracking with Piwik is very nice!
August 31st, 2009 at 7:21 pm
statcounter also use piwik as its primary infrastructure and it is good choice.
September 5th, 2009 at 4:36 pm
Very good work!
Thank you.
September 5th, 2009 at 6:45 pm
I like the modularity feature that could be integrated with other open source softwares.
September 8th, 2009 at 5:50 pm
This Api requires engineering craft. Great job.
September 11th, 2009 at 11:12 pm
Good job. I'm looking forward to the new release.
September 13th, 2009 at 3:13 am
If you start using it once how can you live without it.
Love it.
September 16th, 2009 at 9:10 pm
It is new to me that Statcounter uses Piwik too, but if it does it must be a good choice indeed.
September 16th, 2009 at 9:11 pm
Yes I agree, thanks a lot!
September 16th, 2009 at 9:12 pm
Piwik rocks!
September 17th, 2009 at 2:02 am
Very good work!
Thank you.
September 17th, 2009 at 2:22 am
I like the modularity feature that could be integrated with other open source softwares.
September 17th, 2009 at 12:41 pm
absolute awesome ap! Thanks for that cool work.
September 17th, 2009 at 12:48 pm
Thanks for Tipps and helpfull information!
September 17th, 2009 at 12:52 pm
super site with good information many thanks!
September 18th, 2009 at 1:20 pm
Thanks alot you Guys are awsome!
September 21st, 2009 at 10:18 am
Wow, thats really great. You guys rules!
September 23rd, 2009 at 1:03 pm
adding new piwik javaschript
its perfect work
thanks
from namensschilder yahoo blog
September 23rd, 2009 at 4:35 pm
Thanks for your effort :) Seems like Piwik is getting better and better. I'll definitely take a look..
September 25th, 2009 at 12:40 pm
Piwik just made my day! Hooray!
September 25th, 2009 at 3:57 pm
nice tool, but there are still some bugs whit big sqls. hope this will be fixed soon.
September 25th, 2009 at 4:51 pm
Very good!
Thank you.
October 2nd, 2009 at 6:41 pm
Thanks for Tipps and good information! Great job!
October 3rd, 2009 at 1:37 pm
I love Piwik, good news that you won the award!
October 9th, 2009 at 12:31 am
Piwik is great, thanks for this awesome tool.
October 9th, 2009 at 11:00 am
Piwik is a perfect tool for the webanalysis!
October 10th, 2009 at 11:19 pm
Piwik is a great tool, thanks so much.
October 10th, 2009 at 11:45 pm
thanks so much for your great work.
October 11th, 2009 at 12:07 pm
great work, thanks so much for your assistant
October 14th, 2009 at 4:21 am
Ja Bless
October 16th, 2009 at 9:41 am
we love Piwik, one of the best tools we have ever seen. thank you so much for this great piece of software
October 17th, 2009 at 8:53 am
Yes I agree, thanks a lot! I love Piwik
Regards,
KinkyNice
October 19th, 2009 at 2:41 pm
Piwik is really the best tool I've ever seen! Thank you very much for this great support.
October 20th, 2009 at 5:11 pm
thanks so much, you are the best
October 21st, 2009 at 8:19 am
Nice tool and great work. Nice to track customers. Thanks.
October 21st, 2009 at 1:41 pm
Great work!! Piwik make me happy. Thanks a lot!
October 21st, 2009 at 3:15 pm
Really great work.
Thank you.
October 21st, 2009 at 11:37 pm
Really great work!
I looked for such a script and stumbled accross Pwik. Nice tracking features and very supportive. Will try to integrate Piwik into another website.
Keep up the good work!
regards,
October 23rd, 2009 at 9:02 pm
This is a great work an a nice tool. Thanks for that.
October 24th, 2009 at 11:26 pm
Cool tool. Really like it and appreciate your work!
October 29th, 2009 at 9:20 pm
I really needed an alternative to Google Analytics for my new projects - I am testing it right now and hope I have found what I've been looking for…
Br,
Andreas
October 29th, 2009 at 9:33 pm
Just checking it out - wonderful software.
Br,
Andreas
November 1st, 2009 at 8:07 pm
Really nice work, thanks for sharing this.
Was really helpfull.
Greetings, Toni
November 2nd, 2009 at 10:01 pm
Thx for information. it looks good….maybe i ll try it….well done
November 4th, 2009 at 11:31 pm
thx for this helpful post. it works
November 5th, 2009 at 1:59 pm
thanks for the great information.
looks really good to me
November 8th, 2009 at 6:33 pm
I will use it on my site about "dauerhafte Haarentfernung mit Laser" from now on!!!
November 9th, 2009 at 9:39 am
I´m of same opinion. Great work!
November 9th, 2009 at 9:43 am
good work - very helpfull for my site
November 17th, 2009 at 2:56 pm
very good work - i will use it on my site
November 24th, 2009 at 3:55 pm
wow… all stuff about Piwik sounds great, i will try it on my sites! Thanks!
December 4th, 2009 at 2:02 pm
Great inspiration. Will consider the tip for my website.
December 6th, 2009 at 7:39 pm
Die neue API Schnittstelle ist wieder einmal eine hervorragende Sache. Leider braucht man dafür programmierkenntnisse so dass ich da an meine Grenzen stosse. Aber ich steh trotzdem voll auf Piwik.
December 21st, 2009 at 9:35 am
Naja jeder kennt ja bestimmt einen der ein bisschen programmieren kann, man hilft sich eben gegenseitig aus oder nicht? Der eine kann dies dafür der andere das, aber Piwik ist trotzdem klasse auch mit wenigen Programmier Kentnissen.
Piwik Rockt
December 23rd, 2009 at 2:20 am
danke danke
December 31st, 2009 at 3:42 pm
Really nice work, thanks for sharing this.
January 3rd, 2010 at 3:50 am
good work!
i will try it on my sites! Thanks!
January 16th, 2010 at 8:20 pm
Many Thanks for this useful software!
January 18th, 2010 at 11:43 pm
Great work!!
January 30th, 2010 at 6:00 am
Cool tool! Thank you.
January 30th, 2010 at 7:00 pm
We say thx ;)
January 31st, 2010 at 8:07 pm
I am totally happy with piwik.
It can helps me to save a lot of time for analysing my customer for Ferienwohnungen in Cuxhaven Duhnen.
February 4th, 2010 at 8:38 am
Thats very great and thank you very much! L.H.
February 4th, 2010 at 8:41 am
We appreciate it very much and say thank you! Much greetings from switzerland! Mr. Badewanne;-)
February 6th, 2010 at 1:56 am
danke sehr
February 16th, 2010 at 11:01 pm
Thanks! I'm looking forward to the new release
February 17th, 2010 at 7:41 pm
Cool tool. Thanks for the information and for sharing this.
February 19th, 2010 at 12:42 am
Hey i am a citizen and i use Google
February 19th, 2010 at 12:43 am
Lets do
Google.com
February 19th, 2010 at 1:21 pm
I'ts a Great work!!
February 19th, 2010 at 2:18 pm
Really nice work, thanks for sharing this.
February 19th, 2010 at 4:45 pm
Congratulations, very nice !
Give thanks for sharing this¨!!!
February 19th, 2010 at 8:04 pm
Hi, thanks for sharing, but i also have problems to catch he non-js Visitors in this site. What to do?
February 21st, 2010 at 12:04 pm
Good Work! Thanks for all your support
February 21st, 2010 at 12:12 pm
Thanks its good work! I really needed an alternative to Google Analytics.
February 28th, 2010 at 1:54 pm
Very good work, i like Piwik. Keep on the great work for this project.
March 2nd, 2010 at 4:18 am
It now has similar functionnality to the Google Analytics and Yahoo Analytics, check it out! It also allows developers to pass custom JSON data to be used by plugins.
Also, it is fully compatible with the old Javascript so you don't need to re-tag your websites…
March 3rd, 2010 at 3:50 am
One notices in Piwik nor that it is in beta status. However, the tracking can convince on its own servers. This is due mainly to the export function and the ability to install plugins. Special USP Piwik it is to have to give the data is no longer out of the hand or to an external service like Google and still not losing a JavaScript-based tracking method to have. And all of it free of charge and in constant evolution.
March 3rd, 2010 at 10:54 am
Thanks for that perfect tool, I will use it!
March 4th, 2010 at 2:02 pm
Thanks for the great Tool. I needed for my work.
March 6th, 2010 at 5:51 pm
It is good news that you won the award! I like Piwik!
March 6th, 2010 at 5:53 pm
Thanks for that cool piece of work.
March 9th, 2010 at 7:35 pm
Great application. Thank you very much!
March 11th, 2010 at 3:06 pm
Thanks Piwik team! We are using Piwik and love the results.