Log click
-
Hello! I need to log some links with this plugin (I need this way, not alternative plugins) so I made this:
my content page
<a it="test-tracking1" href="#" class="track">Test Tracking</a>
theme footer.php
<script type="text/javascript"> $(document).ready(function() { $(".track").click(function() { tracklink(); }); }); function tracklink(el) { var the_id = $(el).attr("id"); var test = "test"; $.ajax({ type: "POST", url: 'functions.php', data:{action:'track', nome:'<?php echo $trackinguser; ?>', titolopagina:'<?php echo $trackingtitle; ?>', pulsante: the_id}, success:function(html) {} }); }; </script>
theme functions.php
if($_POST['action'] == 'track') { $linktrackingtitle=$_POST['titolopagina']; $linktrackinguser=$_POST['nome']; $linktrackingbutton=$_POST['pulsante']; do_action( 'wp_log_info', 'Click', $linktrackinguser . ' ha cliccato su ' . $linktrackingbutton . ' in ' . $linktrackingtitle ); }
But it doesn’t work… What’s wrong?
Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Log click’ is closed to new replies.