Loading...
 

Piwik Web analytics


"Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. It provides you with detailed reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages… and so much more."
http://piwik.org/

Like Tiki, Piwik is written in PHP using a MySQL database.

To record visitors, visits and page views in Piwik, you must add a Tracking code in all your pages. Piwik recommend to use the standard JavaScript Tracking tag.

The documentation is here:
http://piwik.org/docs/javascript-tracking/

Copy the code from piwik and paste in Admin -> Look & Feel -> General Layout or Customization (depends on your version of Tiki) -> Custom End of <body> Code surrounded by literal tags, as shown below:

In Tiki5 or newer
{literal}

<!-- Piwik -->
<script type="text/javascript">
...
...
...
</script>
<!-- End Piwik Tag -->

{/literal}


The literal tags indicate to the Smarty template engine not to interpret the code and to pass it as-is.

direct URL to access Custom End of <body> Code is: tiki-admin.php?page=look&cookietab=2


Only use the tracking code for users that do not have full admin rights
{if $tiki_p_admin neq 'y'}
 {literal}

  <!-- Piwik -->
  <script type="text/javascript">
   ...
   ...
   ...
  </script>
  <!-- End Piwik Tag -->

 {/literal}
{/if}

For better integration of Tiki with Piwik

To identify users logged into Tiki and track their activity, modify the default Piwik code to pass the Tiki username to Piwik. This is done by adding the following in Admin -> Look & Feel -> Custom End of <body> Code. Note that the Tiki username must be passed before 'trackPageView' in the default Piwik code to track user activity reliably.

Pass Tiki username to Piwik, see analytics of user activity in Piwik reports
{literal}
  <!-- Piwik -->
<script type="text/javascript">
...
...
...
{/literal}
{if $user}{literal}
  _paq.push(['setUserId', {/literal}'{$user}'{literal}]);{/literal}
{/if}{literal}
  _paq.push(['trackPageView']);
...
...
...
</script>
  <!-- End Piwik Tag -->
{/literal}

Piwik Visitor Log shows activity of Tiki user 'admin' in one session and an anonymous user in the session before that
Piwik Visitor Log shows activity of Tiki user 'admin' in one session and an anonymous user in the session before that

Embedding Piwik report on a Tiki Wiki page

It is possible to embed piwik report into wiki page.

  • In Piwik Admin
    • Permission and User
    1. Go to setting, users.
    2. Set permission for anonymous so all the data will be public or create a specific user to create a token that will be used for authentication (recommended and explained here).
    3. In Manage Access give this user "View" permission for the website(s) you want the token to be used to share the report.
    • Report Selection and Credentials
    1. Click on the user icon (top right), select widget
    2. Select the kind of report you want to display and copy the HTML code found in the field "Embed Iframe" (at the bottom of the preview). Paste it in a text-editor.
    3. Add at the end of the "src" (it should start by "http://yourpiwikdomain.com...") the parameter to the API calls URLs that require authentication: "&token_auth=". Paste the token_auth you created for your specific user.

You have now all the necessary and basic code that should be placed in a Tiki Wiki page.

  • In Tiki
    1. Create or edit the page where you want to display the report.
    2. Set permission for your usage (it can be embedded inside group plugin for example).
    3. Insert an HTML plugin and paste the code you've prepared.
    4. Approve the plugin
    5. Tada !

Visits Summary, Visits Overview (with graph) for Doc.Tiki.org



Visitor Setting, Screen Resolution for Doc.Tiki.org



Actions, Pages for Doc.Tiki.org



Creating a Plugin for Tiki


Requirement

  1. Install on all page "JavaScript Tracking Code"
    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u="//domain_name/piwikwebsite_name/";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', 1]);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <noscript><p><img src="//localhost:8888/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
    <!-- End Piwik Code -->

    Installed at tiki-admin.php?page=look in the meantime


Notes:

(more to come...)

To-Do:

  • http vs https
  • Adding date range
  • Adding periods
  • Force height for specific widget
  • Set filtering and sort (&filter_sort_column=gt_ms)
  • Hide columns properly (&hideColumns=avg_time_on_page) set data to "-" but display the column.
  • Have the widget language set to Tiki language preferences.
  • Get 404 pages (http://piwik.org/faq/how-to/faq_60/)
  • Find is slow pages or slow query can be added to report
  • Verbose error (token hs or no server url error)
(more to come...)

Documentation available at : http://piwik.org/docs/embed-piwik-report/

See also Template Tricks

Related: Google Analytics


doc.tiki.org


Bootstrap

AdminGuide

UserGuide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting (7.x)
Articles and Submissions
Backlinks
Banners
Batch (6.x)
BigBlueButton audio/video/chat/screensharing (5.x)
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution (2.x)
Cookie
Copyright
Credit (6.x)
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs 8.x
Draw 7.x
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management (4.x)
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Lost edit protection
Mail-in
Map with Mapserver
Menu
Meta Tags
Mobile Tiki and Voice Tiki
Mods
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links (3.x)
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags (2.x)
Task
Tell a Friend, alert + Social Bookmarking
TikiTests (2.x)
Theme CSS & Smarty
Trackers
Transitions (5.x)
TRIM
User Administration including registration and banning
User Files
User Menu
Watch
WebHelp
WebDAV (5.x)
Webmail
Web Services
Wiki 3D
Wiki History, page rename, etc
Wiki Page Staging and Approval (2.x)
Wiki Plugin extends basic syntax
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG (2.x)
XMLRPC


Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki
Show php error messages