HTML Script to call Google Analytics Event Tracking when email address is clicked
$15-40 USD
Awarded
Posted almost 9 years ago
$15-40 USD
Paid on delivery
I have a website that tracks when a user has clicked away from the site.
This is tracked through google Analytics,
Here is the code:
<script type="text/javascript">
$( document ).ready(function()
{
var current_url = $(this).attr('href');
c=document.location.protocol+'//'+document.location.host+'/';
$( document ).on( "click", "[login to view URL]", function()
{
[login to view URL](['_trackEvent', 'ExitLinks', 'Click', [login to view URL]]);
return confirm('You are now leaving the LAP-BAND(tm) System Website');
});
});
</script>
And the links look like this:
<p><a class="external" href="[login to view URL]" target="_blank">[login to view URL]</a></p>
Here is an example online:
[login to view URL]
When someone clicks on the link, it generates a pop-up and if they click through, it creates an event in google anaytics
[login to view URL](['_trackEvent', 'ExitLinks', 'Click', [login to view URL]]);
I would like to create the same event (without the pop-up) when someone clicks on an email address on the page.
Please note that this is a joomla website.
Thanks
Hi, can make it within an hour, just to make you note, now the event is created even if user cancels the alert. if you wish i will make it work as you described
hello
hope you are doing well
I am interested to work on this project.
can we discuss more you dont need a confirmation box that open when you click on link right
lets do it now in 10 minutes
As a Google Analytics implementation specialist, I perform this type of task multiple times every day. I can get this done quickly and effectively, please message me if you need any more information or have any questions.