The image button should have an OnClientClick property, which you can define the JS code that will run before the control posts back. Reference that method from there.
HTH.
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Thanks for replying appreciate it, but since i am already using onclick method for the imageButton, now if i use OnClientClick, does this not result in double clicking,
or does this throw an error....... sorry i am just in a learning stage.
Member
14 Points
107 Posts
how to add google analytics goal to a asp:button click
Feb 19, 2010 09:27 AM|learning.net|LINK
Hello Experts,
i am currently using Google Analytics to collects stats about my site ( my site is created in ASP.NET 2.0 and C#).
i have asp:imagebutton called "Confirm Order". i want to track the clicking of this button.
the code for this button is as follows:
my question how can i add the GA tracking script to this button click in the code behind.
my GA tracking Script is like below:
Thanks and i really appreciate any help.
I want to know how i can add this script to the onclick code above to so i can track the button clicks.
Thanks
Star
8431 Points
5736 Posts
MVP
Re: how to add google analytics goal to a asp:button click
Feb 19, 2010 10:47 AM|bmains|LINK
Hey,
The image button should have an OnClientClick property, which you can define the JS code that will run before the control posts back. Reference that method from there.
HTH.
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Member
14 Points
107 Posts
Re: how to add google analytics goal to a asp:button click
Feb 19, 2010 11:45 AM|learning.net|LINK
Thanks for replying appreciate it, but since i am already using onclick method for the imageButton, now if i use OnClientClick, does this not result in double clicking,
or does this throw an error....... sorry i am just in a learning stage.
Thanks
Member
14 Points
107 Posts
Re: how to add google analytics goal to a asp:button click
Feb 19, 2010 07:08 PM|learning.net|LINK
thanks that did the trick