Git Product home page Git Product logo

piwik-yourls's Introduction

PIWIK-YOURLS

A Piwik plugin for YOURLS

Features

  • Logs all requests with Piwik
  • Tracks IP and custom variables
  • Lets you disable local tracking/stats
  • Includes "Don't Log Bots" from OZH

Requirements

  • PHP 5.3
  • PiwikTracker.php from your Piwik installation

Setup

YOURLS

  • Pull the files to <yourls_root>/user/plugins/piwik
  • Place PiwikTracker.php into the <yourls_root>/user/plugins/piwik/libs/Piwik folder
  • Activate the plugin in the admin zone of YOURLS
  • Go to the plugin page and fill in the required fields

If you want better alert messages, you need to apply this change to your YOURLS installation.

Piwik

  • Create a test "website" and use that at the beginning until you find the right way to log your hits
  • Create or assign an admin auth token to that site
  • Visit some of your links
  • Check the hits on the "Visitors in real-time" widget

Modifications

If you're not happy with the way hits are tracked, just change the way the plugin does it by editing:

	// This shows up in the visitor logs and identify the source of the data
	$pt->setCustomVariable(1, 'App', 'Piwik plugin for YOURLS', 'visit');

	// Some useful variables
	$pt->setCustomVariable(2, 'Domain landed', $domain_landed, 'page');
	$pt->setCustomVariable(3, 'Keyword', $keyword, 'page');

	// Track the visit in Piwik
	$title = yourls_get_keyword_title($keyword);
	@$pt->doTrackPageView($title);

	// The destination URL will show up as an outlink
	@$pt->doTrackAction($destination, 'link');

in plugin.php, function "itfs_piwik_log_request"

Inspiration

License

Copyright 2012 - interfaSys sàrl - www.interfasys.ch

Licensed under the GNU Affero General Public License, version 3 (AGPLv3) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.gnu.org/licenses/agpl-3.0.html

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

piwik-yourls's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

piwik-yourls's Issues

Unable to see tracking in Piwik

Is this plugin still being maintained?

I am having the same issue that was reported here, #6 , and cannot overcome the problem.

Thank you.

Short URL go in white page

Hello,

My Yourls installation create short links but when I go in theses links, I arrive on white page.

Exemple : https://go.breat.fr/M0VWh

My .htaccess is like this and automatically generated by Yourls :

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
</IfModule>
# END YOURLS

I use theses plugins :

  • Admin reCaptcha
  • Allow Hyphens in Short URLs
  • Check URL
  • Fix Long URL
  • Mailto: quickshare
  • Piwik-YOURLS
  • Pseudonymize Plugin
  • Random ShortURLs
  • Share on Tumbler
  • Sleeky themes
  • detect-mobile-device

I disable all plugin one by one and the problem come from Piwik-YOURLS.
So I disable it waiting a solution.

Can you help me ?

NGINX reverse proxy IP logged onto Matomo

I'm having an issue having the X-Forwarded-For and X-Forwarded-Proto values passed onto Piwik by the plugin. Both Matomo and yourLS register the IP values correctly, but values passed on by the plugin point at the nginx reverse proxy instead.

No tracks at all

I've installed the plugin as described in the ReadMe, but my Piwik doesn't track any hits at all. Am I doing something wrong or is this just deprecated?

wrong URL tracked

If YOULRS is not installed in the webroot but in a subfolder, the tracked URL is wrong. Let's say YOURLS is installed in domain.tld/g and a short link looks like domain.tld/g/test. Than the URL domain.tld/test is passed to piwik instead of domain.tld/g/test.
Wouldn't it be better if the constant YOURLS_SITE is used instead of $_SERVER['HTTP_HOST']?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Add ssl support

Currently I can't connect to my piwik instance via ssl. Not sure if it's because I'm using a self signed cert. or because your plugin doesn't support https connection at all.

By the way you made my day with this plugin! ;-D
Many thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.