1.9K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
Guide Me

Implementing an Event

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi everyone!

I would like to implement an event for hitting a play button for a video and for downloading a pdf file.

I couldn't find a specific command in the Help center, though I have find in this forum the next command(here it's a mail):

<a href="mailto:office@spectrum-plant.com" onclick="ga('send', 'event', 'contact', 'clicked');">office@spectrum-plant.com</a>

 Besides this I have found  this command : (from koozai.com)
<a href=”/downloads/whitepapers/seo-is-great.pdf” onClick=”_gaq.push([‘_trackEvent’, ‘whitepaper’, ‘download’, pdfName, pdfValue, true]);” target=”_blank”>SEO Is Great Whitepaper</a>


Now I'm very confused which command is the proper one? the first one which uses ="ga('...)  OR the "_gaq.push(['_...)

Even the Google Developer's site doesn't seem to answer that, it doesn't give a full example as appears above so
I don't know which one would work


Please pay attention that those commands are solely for clicking a link what about embedded video from YouTube?

What would the command look like for hitting the play button of it??


Thank you for helping! 

Re: Implementing an Event

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
In addition I would like to ask, how can I differ between 2 events?
Let's say I have 2 buttons of download, but each one is different (one is for PDF file and the other is WORD)
How 2 events be created so the system will distinguish between them and where do I see it in the command?