Jump to content

Setting current time variable as trackEvent value in Google Analytics


sjjs1985

Recommended Posts

I simply want to set the current time as the trackEvent value. Why isn't this working anybody? Thnaks

 

-----------------JavaScript, this is working fine -------------------------

 

<script type="text/javascript">

var currentTime = new Date()

var hours = currentTime.getHours()

var minutes = currentTime.getMinutes()

var timeStamp = (hours + ":" + minutes + " ");

</script>

 

-----------------html, what am I doing wrong?------------------------

 

onclick=" _gaq.push(['_trackEvent', 'Time', 'Time:' + timeStamp]);"

 

 

 

i'm guessing its the '+ timeStamp' section of the code.

all help greatly appreciated. thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.