gangsta245
New Member
I have a problem and I can't figure it out how to solve it. I search for solutions but they did not work. So, I have a Datalist with ItemTemplate. I need to add google analytics on onclick event to <a> tags. I tried to add the onclick event like
\[code\] onclick="_gaq.push(['_trackEvent', 'Homepage', 'Click on',<%#DataBinder.Eval(Container.DataItem,"URL")%>']);" <br />\[/code\]but I get a yellow error screen with the message "..tag is not formatted correctly".I also tryed replacing double qoutes with \[code\]&qout;\[/code\] but no success. I also tried
\[code\]onclick='<%# string.Format("_gaq.push(['_trackEvent','Homepage','Click on last awarded company','{0}']);", DataBinder.Eval(Container.DataItem, "URL") %>' <br />\[/code\]but this also not worked.
Have you got any idea how could I solve this problem?
\[code\] onclick="_gaq.push(['_trackEvent', 'Homepage', 'Click on',<%#DataBinder.Eval(Container.DataItem,"URL")%>']);" <br />\[/code\]but I get a yellow error screen with the message "..tag is not formatted correctly".I also tryed replacing double qoutes with \[code\]&qout;\[/code\] but no success. I also tried
\[code\]onclick='<%# string.Format("_gaq.push(['_trackEvent','Homepage','Click on last awarded company','{0}']);", DataBinder.Eval(Container.DataItem, "URL") %>' <br />\[/code\]but this also not worked.
Have you got any idea how could I solve this problem?