NOTE: This plugin is developed with SVN Version. There are incompatibilities with 1.5+ version
A plugin for YOURLS that add Google Analytics tracking code to all your html pages.
How it works:
Add Google Analytics tracking code before your footer. Remember that Shortened address will not be tracked, they are tracked by YOURLS.
How to install:
- Copy plugin files to /user/plugins/ganalytics/ folder.
- Access the administration area and activate the plugin.
GANALYTICS_ACCOUNT is the tracking code for your account (UA-XXXXXXX-YY)
Google Analytics YOURLs Plugin 1.0 beta
Hey, great plugin! This is just what I was looking for. Just a quick question though, why do you not track the shortened URLs also?
It is possible to track Shortened URLs too. But, if I want to do this, I will need to create an intermediate page that tracks the code and then it is redirected to the real URL. I didn't want to create this because it can be slower with this. But it is possible.
Do you think it is a nice feature?
- why "multi-user" folder?
- it doesn't track clicks on short URL, only stats & admin page views, that should be made clearer for readers (the less tech savvy will get confused)
- I didn't find any "multi-user" folder in this plugin, at least in the one attached to this post.
- I agree, I intend to create a version that it can track the shortened URLs too.
Mat: the /multi-user/ directory is mentioned on the English page of the plugin: http://wordpress.matbra.com/en/code/google-analytics-yourls-plugin/
Oh, that is right Ozh, thanks for your feedback.
Just fixed it.
Hey Matheus, yes I am interested in seeing GA in the short URLs. I had the same idea about having a redirect page. The thought came to me when I looked at the redirect prompt page in Ozh's plugin example. Perhaps adding the Google Analytics codes into that page and then just quickly passing over that page from the shortlink, to the prompt page with the GA code, and then to the long URL, would be enough for the GA.
I don't have any use for tracking the long URLs, I am only interested in the short URLs. The long URLs defeat the purpose of the excersise.
Yes I don't like this issue of having to wait 12 hours to test my code. Right now I'm looking for a way to get instant feedback. I know there are ways to do this, I just haven't done the research yet to see which is the best.
I'm a Co-op student who's been instructed to figure this out, so I'll be spending the next while figuring this out.
If you discover how to do it, please let me know!
I'm pretty sure it will not work if you put in the top of the yourls-go.php. But go ahead and try, and let me know. Any new information are welcome! Best regards
Still no luck.
I've installed Piwik (an open source alternative to Google Analytics) and it loads every 10 seconds new hits. This makes it a lot better for testing.
yourl-go.php does not work.
I am trying to write a plugin but it still isn't working!
have you managed to sort it out?
Tracking the short url is definitely much more important than the long url.
Couple caveats though: it will look like all of these requests are coming from the IP address of your server and you also won't get the client browser information. Still makes a decent way to get the data into GA and you can set up a segment to filter those requests out of other reports so you don’t skew other numbers.
How do I add my account to the plugin?
['_setAccount', '" . GANALYTICS_ACCOUNT . "']);
['_setAccount', '" . UA-XXXXXXX-YY . "']);
Inside your config file use:
Should I add that line in the 1st plugin.php line ?
I had better success with this plugin