Avatar of azimuth28
azimuth28 asked on

Event tracking - Google Analytics

Hi,
I want to track the clicks on outbound links in Google Analytics and i've setup an event tracking (see below).
The reports should show me the clicks on the links included in the div with the id="mydiv", that's why i've setup that function to append the event to all the hrefs in that div.
The thing is i cannot see any data in the Event tracking in Analytics reports. I must be doing something wrong?!
Please help
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxxx-xx']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


<script type = "text/javascript">
    // Define the entry point
    $(document).ready(function()
    {
        $('a','#mydiv').click(function() {
          _gaq.push(['_trackEvent', 'Leads', 'select');
        });
    }
</script>

<div id="mydiv">
<a id="id1" href="/Redirect.aspx?key=1">select</a>
<a id="id2" href="/Redirect.aspx?key=2">select</a>
<a id="id3" href="/Redirect.aspx?key=3">select</a>
</div>

Open in new window

MiscellaneousInternet MarketingWeb Development

Avatar of undefined
Last Comment
jglazer63

8/22/2022 - Mon
Amandeep Singh Bhullar

ASKER
azimuth28

I've already check those pages
Thanks anyway
ASKER
azimuth28

I don't know if my functions are setup wright in order to accomplish my goal. To track the clicks on the "select" hrefs in Event tracking reports
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
azimuth28

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
azimuth28

Solved
jglazer63

Solved how?