Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable mailto:tracking #2731

Closed
mattab opened this issue Oct 21, 2011 · 2 comments
Closed

Disable mailto:tracking #2731

mattab opened this issue Oct 21, 2011 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Oct 21, 2011

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>
@mattab
Copy link
Member Author

mattab commented Oct 21, 2011

(In [5356]) Fixes #2731

@anonymous-matomo-user
Copy link

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/

@mattab mattab added this to the 1.7 Piwik 1.7 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants