Run Analytics on your Windows Azure Website – Part II

Setup your existing WebSite to allow Piwik Application to collect data

Every web page must includes the JS code required for Piwik  as seen below :

<!– Piwik –> <script type=”text/javascript”> var _paq = _paq || []; (function(){ var u=((“https:” == document.location.protocol) ? “https://{$PIWIK_URL}/” : “http://{$PIWIK_URL}/”); _paq.push([‘setSiteId’, {$IDSITE}]); _paq.push([‘setTrackerUrl’, u+’piwik.php’]); _paq.push([‘trackPageView’]); _paq.push([‘enableLinkTracking’]); var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0]; g.type=’text/javascript’; g.defer=true; g.async=true; g.src=u+’piwik.js’; s.parentNode.insertBefore(g,s); })(); </script> <!– End Piwik Code –>

You can learn more about this Javascript code in this article  . Piwik allows you to

  • track multiple websites
  • access to multiple users
  • install third party plugins

This is all it takes to set up Piwik for your website .   To view your website usage  data, login to Piwik site you created on Windows Azure Websites .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s