cydrobolt / polr

:aerial_tramway: A modern, powerful, and robust URL shortener
https://polrproject.org
GNU General Public License v2.0
5k stars 889 forks source link

Piwik #102

Open Preovaleo opened 9 years ago

Preovaleo commented 9 years ago

Hello,

Is it possible to replace your stat with piwik by using the PHP api ? http://piwik.org/docs/tracking-api/#piwik-tracking-api-advanced-users http://developer.piwik.org/api-reference/PHP-Piwik-Tracker

Thank you

cydrobolt commented 9 years ago

Yes, you should be able to use Piwik just fine using the PHP api. Simply paste the PHP code into all the layout files (layout-.php, admin/layout-.php) at the place you need them to appear.

Preovaleo commented 9 years ago

Yes, But this was not exactly what i mean, i want to integrate piwik in the r.php file.

cydrobolt commented 9 years ago

Ah, I see. You should be able to integrated it nonetheless. You can try something like this in r.php Try adding this before line 45 on r.php

$piwikTracker = new PiwikTracker( $idSite = {$IDSITE} );

$piwikTracker->setUrl($row['rurl']);
// Sends Tracker request via http
$piwikTracker->doTrackPageView('Polr Redirection');

You can also replace $row['rurl'] with "http://$wsa/$row['baseval']" if you want Piwik to receive the Polr short link rather than the "long" shortened link.

Amplificator commented 8 years ago

@cydrobolt have you considered adding built-in and proper Piwik support for v2?

cydrobolt commented 8 years ago

I think it would be reasonable to have it as a plugin to 2.0

Preovaleo commented 8 years ago

Asking in #126 how to add plugin?

kbabioch commented 7 years ago

Has this been revisted since then? Sounds reasonable to me :-).

vectr0n commented 7 years ago

Would be nice to see some options appear instead of being forced to hack in something pretty basic these days.

strugee commented 7 years ago

@vectr0n, @cydrobolt (presumably) maintains this in their spare time. If you think Piwik support is important, you are welcome to write and contribute the feature yourself.

cydrobolt commented 7 years ago

I do maintain the project in my spare time. If you'd like to contribute this feature, please send a PR and I'll take a look at it. If you've already implemented it through a simple hack on your instance, it shouldn't be too much work to send in a PR for this change.

Here's an interesting package that could be used: https://github.com/RobBrazier/Laravel_Piwik

As I've mentioned before, there are also many other issues to be addressed, so I can't give you any ETAs on when this can be implemented. Please take a couple minutes to send a PR if you can! That would be super helpful :)

korrio commented 6 years ago

Any other update since 2015, will try https://github.com/RobBrazier/Laravel_Piwik