This is a migrated thread and some comments may be shown as answers.

Integrating google analytics for panel items

1 Answer 38 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Amol Shah
Top achievements
Rank 1
Amol Shah asked on 07 Dec 2009, 08:31 PM
Hi,
Google analytics has the following javascript method to track ajax calls: pageTracker._trackPageview("/pagefilename1" );

I would like to integrate this with the RadPanelBar in our solution so that I can track/distinguish the different RadPanelItems that the users are clicking.  Can someone provide an example on the best way to accomplish this?

Thanks,
Amol

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 11 Dec 2009, 07:56 AM
Hello,

We haven't tried this yet, but it should be very much doable. You can use the ClientItemClicked event and call the GA code there:

function OnClientItemClicked(sender, args)
{
   var item = args.get_item();
   pageTracker._trackPageview(item.get_text());
 
   // Or use a custom attribute
   pageTracker._trackPageview(item.get_attributes().getAttribute("GAKey"));
}

More info on custom attributes can be found here:
http://www.telerik.com/help/aspnet-ajax/panel_clientsideradpanelbaritem.html

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
PanelBar
Asked by
Amol Shah
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or