Track Downloads


(kleinanz) #1

Hello,

is it possible to track downloads without extensions?
(e.g. ?xxx=downloadfile)

kleinanz


(michaelc) #2

Hi kleinanz,

Welcome to the Piwik community forums!

You can try with the config file settings. As a default there is a following behaviour:

; variable name used to specify a download link
; Example: ‘/piwik.php?idsite=1&download=http://piwik.org/piwik.zip’ will redirect to 'http://piwik.org/piwik.zip
download_url_var_name = download

; variable that contains the name of the download or the outlink to redirect to
; Example: '/piwik.php?idsite=1&download=http://piwik.org/piwik.zip&name=Piwik last version’
download_outlink_name_var = name

So, instead of xxx you should use a download parameter, or change the default value in the config file.


(kleinanz) #3

Hi michaelc,

I tried it to change into “xxx” but our downloads do not have a file extension.
So far as I know Piwik just tracks downloads with certain filex extensions (e.g. image.jpg) but not without (e.g. image).
How can I change this?

Thanks for your help!


(robocoder) #4

Please see http://piwik.org/docs/javascript-tracking/
and scroll down where it says, “Force a click on a link to be recorded as a download in Piwik”.

There are other use cases / examples there as well.


(Mathias) #5

sry for grab this thread out of nowhere… but it really nearly deals with my problem…
Well the problem is that i’m using Piwiki on a Subdomain (stats.domain.com),… so well my problem now is that I use a PHP Script for deliver the download content,… is is like a printing site (best look here: http://entwicklung.lm-fahrschule.de, be aware that piwiki is disabeled on that site!)… it ends like an normal site it’s an mod rewrite and all stuff is handeled by the index.php and the extension is .lm
And if I want to print smth. it is druck_filename.lm what is the best way to get an working Download statistics?
I tried http get but I think it was the wrong url…

Greetings from Germany

Mathias


(David Allouch) #6

What i ended up doing is not pretty but working.
In my download script i add the following code:

<?php $GLOBALS['PIWIK_TRACKER_DEBUG'] = false; define('PIWIK_TRACKER_MODE', true); define('PIWIK_INCLUDE_PATH', '/var/www/html/piwik'); @ignore_user_abort(true); set_include_path(PIWIK_INCLUDE_PATH . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/core' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/libs/' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins/' . PATH_SEPARATOR . get_include_path() ); require_once "Common.php"; require_once "PluginsManager.php"; require_once "Tracker.php"; require_once "Tracker/Config.php"; require_once "Tracker/Action.php"; require_once "Cookie.php"; require_once "Tracker/Db.php"; require_once "Tracker/Visit.php"; require_once "Tracker/GoalManager.php"; $my_array= array('idsite' => '1','download' => $mydownloadurl , 'redirect' => '0' ); $_GET=$my_array; ob_start(); $process = new Piwik_Tracker; $process->main(); ob_clean(); ?>

I cooked this from different readings. but the bottom line is that it is working.
The only problem i am trying to solve now is that it refuses to load the “Goal” plugin.
Any suggestion to make this better or even to get the goal plugin to load would be most welcome.

Cheers,

D.


(Mathias) #7

Hey David,
thanks for sharing your code, I will try it ASAP (maybe tomorrow). I will give u feedback here if it works…
So far
Greetings
Mathias


(David Allouch) #8

hehe off course it works.
I am back in the code trying to get the Goals plugin to load.

D.

[quote=Mathias @ Apr 18 2009, 11:28 AM]Hey David,
thanks for sharing your code, I will try it ASAP (maybe tomorrow). I will give u feedback here if it works…
So far
Greetings
Mathias[/quote]


(Mathias) #9

[quote=David Allouch @ Apr 20 2009, 08:20 AM]hehe off course it works.
I am back in the code trying to get the Goals plugin to load.

D.[/quote]
Yeah thats what I meant sry if u miss understood this…
thanks a lot until here would love to see the goal plugin working… if u have any cloue about it just share with us =)

Mathias