"man in the middle" piwik

Hi! I absolutely love Piwik and i think it is absolutely on par with Analytics by Google.

I got a bit of a special problem. I have got a customer who sends a punch of newsletters every day. In the newsletter there is a number of directly downloadable pictures (press-photos). Piwik can’t track those clicks via campaigns because there is no javascript executed.

Now my question: Does Piwik offer the functionality to send a user to piwik (for tracking) and then redirect the user to an url.

Something like: https//mypiwik.com/track.php?redirect=myUrl.com/1.jpg

Thanks in advance!

Rather than doing it via direct downloadable images I would direct them to a PHP page with an embedded picture. That page can have JS code on it. They can right click to actually download the file.

OR, you could import the server log daily. The log should have the URL the user used.

Thanks for your fast answer.
I don’t really want to redirect to a php page. Our focus is the best possible user-experience and thats is the directly downloadable file. Especially for people who need to download multiple files.
Thanks for the tip with the server log file. I will have to look into how to set this up.

So, why couldn’t you do what you suggested? you could have an HTML file with a redirect that has the JS code in it:

<JS Tracking code goes here>
Loading Image...
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/1.jpg">

thanks - that could probably work, but has some possible implications.

  • the redirect script could be faster than the tracking script
  • the user has to open a new tab, even if it is just a “download and close” link

If you don’t want to do it with JS then you could do essentially the same thing with PHP and the HTTP tracking API. I don’t understand what you mean by “the user has to open a new tab, even if it is just a ‘download and close’ link”. It would just be a link in an email. The user wouldn’t know that it wasn’t going direct to the image (Especially if you used a rewrite rule in your htaccess or conf).

1 Like

cheers mate. after all you are right. thx for ur help