Integrating google analytics for panel items

2 posts, 0 answers
  1. Amol Shah
    Amol Shah avatar
    1 posts
    Member since:
    Jun 2009

    Posted 07 Dec 2009 Link to this post

    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

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 11 Dec 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top