T
T
Tolya Ivanov2014-11-01 13:11:11
Analytics
Tolya Ivanov, 2014-11-01 13:11:11

How to count clicks on links?

I have a simple site with a side menu, there are links to external sites that open in an iframe, I want to see statistics on clicks on this menu, how can I do this?
I want to install some open source script on my domain, a link like:
anonym.to/?http://ya.ru
only on my domain:
stats.site.ru/?http://yandex.ru
and then in statistics to see who clicks where.
Are there such scripts?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@usupport, 2014-11-02
_

The easiest option is to create a script on your site, for example redirect.php with something like the following content:

<?php
$data=file_get_contents('logs.txt');
$data=$data.$_GET['url']."\r\n";
file_put_contents('logs.txt', $data);
header( 'Location: '.$_GET['url'] );
?>

create a writable log.txt file next to it and contact mysite.ru/redirect.php?url=external_site_address.
Links will be written to the log.txt file, and users will be redirected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question