Opened 3 years ago

Closed 3 years ago

Last modified 14 months ago

#2731 closed Bug (fixed)

Disable mailto:tracking

Reported by: matt Owned by:
Priority: normal Milestone: 1.7 Piwik 1.7
Component: Core Keywords:
Cc: Sensitive: no

Description

mailto: links are tracked with Piwik. However as of 1.6 we do not track any URL that does not start with http. Therefore the mailto clicks are not tracked anymore. We should instead disable completely and not fire a request.

Users can manually track the mailto: links by doing:

<a href="mailto:namexyz@mydomain.co.uk" onClick="javascript:piwikTracker.trackLink('http://mailto/mailto/Agent namexyz', 'link');">namexyz@mydomain.co.uk</a>

Change History (2)

comment:1 Changed 3 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [5356]) Fixes #2731

comment:2 Changed 14 months ago by adrian

To automatically track mailto links, use jQuery and this code

<!--Track mailto-->
<script>
jQuery(document).ready(function($) {
    $('a[href^="mailto"]').click(function(){
	piwikTracker.setCustomVariable(1, "Share By Email",  'Email='+this.href.replace(/^mailto:/i,'') + ' /Page = ' +  location.href, "page");  piwikTracker.trackPageView();
    });
});
</script>
<!--End Track mailto-->

more details: http://www.statstory.com/tracking-mail-to-clicks-with-piwik-analytics/

Note: See TracTickets for help on using tickets.