Google Analytic Event Not Tracking Ruby on Rails -
i wondering whether see wrong way have setup tracking have been testing on , off several days , doesn't seem want track.
#index <head> ... <script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"> ... </head> <body> ... <div class="product-buy"> <a href="<%= url_with_protocol(general.url)%>" onclick="_gaq.push(['_trackevent', 'general', 'click', '<%= general.title %>', '<%= general.position %>']);" target="blank">learn more/visit site</a> </div> ... </body>
i believe have followed analytics guide tee no data seems passing?
any people can offer appreciated.
the issue was passing 3rd argument of '1' string instead of integer.
it should have been general.position turned integer .to_f , speech marks moved analytics doesn't read string.
<body> ... <div class="product-buy"> <a href="<%= url_with_protocol(general.url)%>" onclick="_gaq.push(['_trackevent', 'general', 'click', '<%= general.title %>', <%= general.position.to_f %>]);" target="blank">learn more/visit site</a> </div> ... </body>
Comments
Post a Comment