Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > OnClientClick in transformation is not processed View modes: 
User avatar
Member
Member
kriz-mysafira - 4/26/2011 7:42:53 AM
   
OnClientClick in transformation is not processed
Hello,
I'm not quite sure whether this is a bug or a mistyped page, but I tend to be a bug.

I have got "Download" document type for download files, and fields for form contains:
- heading and summary (not essential)
- link for download - file is force link to file (*.zip)
- OnClientClick="_gaq.push(['_track.... which is Google Analytics tracking

Transformation is:
<a href="<%# Eval("FilePath") %>" <%# IfEmpty(Eval("OnClientClick"), "", Eval("OnClientClick")) %>><%# Eval("Heading") %></a>

In html code is output generated as:
<a href="http://example.org/file.zip" OnClientClick="_gaq.push(['_trackEvent', 'foo1', 'foo2', 'foo3']">Heading</a>

But in google analytics is nothing hit (do not count).
I thing, that problem is in OnClientClick, which is not processed (JS is enabled).

User avatar
Member
Member
kentico_alleng - 4/26/2011 11:32:48 AM
   
RE:OnClientClick in transformation is not processed
In html code is output generated as:
<a href="http://example.org/file.zip" OnClientClick="_gaq.push(['_trackEvent', 'foo1', 'foo2', 'foo3']">Heading</a>


The html output appears to be missing the closing parenthesis. Can you check if the document field contains this?

The generated code should be:
 ... OnClientClick="_gaq.push(['_trackEvent', 'foo1', 'foo2', 'foo3'])" ...


Regards,

Allen Greenhaw

User avatar
Member
Member
AlgarveWeb - 4/29/2011 2:43:23 AM
   
RE:OnClientClick in transformation is not processed
Hi

I was just wondering if you could help me with my post at

http://devnet.kentico.com/Forums/f45/t20248/OnClientClick-inside-Repeater.aspx

Many thanks, Mike

User avatar
Member
Member
kriz-mysafira - 4/29/2011 5:30:53 AM
   
RE:OnClientClick in transformation is not processed
Hello,
thank you for your correction mistake, but in present time I think (what me and co-wrorking testing), that GA do not know event OnClientClick and this event is not append to GA statistics. OnClick is working normal.

Test:
In page is link, that OnClick void method (where is special redirection to different page) and together is OnClientClick where is tracking code.

I find further information leading to a successful solution, I know (it probably will not matter no time).

For now, thank you,
Petr Kriz

User avatar
Member
Member
kriz-mysafira - 5/2/2011 7:38:43 AM
   
RE:OnClientClick in transformation is not processed
Hello,
according to all available information and what we tried, the error is probably in the behavior of GA. Events with OnClientClick in the statistics appear, the OnClick is reflected in the statistics.

Help GA talks about OnCllick. According to Google searches it is probably bypass via jQuery.

Sorry to bug reporting in Kentico, but all suggesting it. In general, surveillance information that OnClientClick works, but it does not work in the trackEvent but operates within pageTracker. It will be interesting to see if that "something" will do.

Thank you,
Petr Kriz