SocialShare - Google Analytics support

GoogleAnalyticsUA="UA-XXXXX-YY"

GoogleAnalyticsUA="UA-XXXXX-YY"

GoogleAnalyticsUA="UA-ZZZZZ-YY"

Event log

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

The RadSocialShare control offers full Google Analytics support which can be enabled by setting a single property - GoogleAnalyticsUA to web property ID (also known as UA number).

Key features:

  • Asynchronous implementation
  • Multi trackers support
  • Having more than one RadSocialShare instances with the same UA will all be logged in the same tracker instead of overidding each other

The console in the demo simulates what is logged on. You can see the logs in real time by using Google Analytics tools, e.g Google Analytics Debugger tool provided by Google.

  • DefaultCS.aspx
  • scripts.js
  • styles.css
<%@ Page Language="C#"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script src="scripts.js" type="text/javascript"></script>
    <link href="styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <script type="text/javascript">
        function socialShare1() {
            return $find("<%=RadSocialShare1.ClientID %>")
        }

        function socialShare2() {
            return $find("<%=RadSocialShare2.ClientID %>")
        }
    </script>
    <div class="demo-container size-wide">
        <h2>GoogleAnalyticsUA="UA-XXXXX-YY"
        </h2>
        <telerik:RadSocialShare RenderMode="Lightweight" ID="RadSocialShare1" runat="server" OnFacebookLike="OnFacebookLike"
            OnFacebookUnLike="OnFacebookUnLike" OnTweet="OnTweet" OnGooglePlusOneOff="OnGooglePlusOneOff"
            OnGooglePlusOneOn="OnGooglePlusOneOn" OnFacebookSend="OnFacebookSend" OnSocialButtonClicked="OnSocialButtonClicked"
            OnLinkedInShare="OnLinkedInShare" UrlToShare="http://www.telerik.com" GoogleAnalyticsUA="UA-XXXXX-YY"
            Width="700" TitleToShare=".NET UI Controls, Reporting, Visual Studio Tools, Agile Project Management, Automated Testing, ASP.NET Web CMS by Telerik">
            <MainButtons>
                <telerik:RadSocialButton SocialNetType="ShareOnFacebook"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="ShareOnTwitter"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Blogger"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Delicious"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Digg"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="GoogleBookmarks"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="LinkedIn"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="MySpace"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Reddit"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="StumbleUpon"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Tumblr"></telerik:RadSocialButton>
                <telerik:RadLinkedInButton CounterMode="Horizontal" ShowZeroCount="true"></telerik:RadLinkedInButton>
                <telerik:RadFacebookButton ButtonType="FacebookLike" ButtonLayout="ButtonCount"></telerik:RadFacebookButton>
                <telerik:RadFacebookButton ButtonType="FacebookSend"></telerik:RadFacebookButton>
                <telerik:RadTwitterButton CounterMode="Horizontal"></telerik:RadTwitterButton>
                <telerik:RadGoogleButton AnnotationType="Bubble" ButtonSize="Medium"></telerik:RadGoogleButton>
            </MainButtons>
        </telerik:RadSocialShare>
        <h2>GoogleAnalyticsUA="UA-XXXXX-YY"
        </h2>
        <telerik:RadSocialShare RenderMode="Lightweight" ID="RadSocialShare2" runat="server" OnFacebookLike="OnFacebookLike"
            OnFacebookUnLike="OnFacebookUnLike" OnTweet="OnTweet" OnGooglePlusOneOff="OnGooglePlusOneOff"
            OnGooglePlusOneOn="OnGooglePlusOneOn" OnFacebookSend="OnFacebookSend" OnSocialButtonClicked="OnSocialButtonClicked"
            OnLinkedInShare="OnLinkedInShare" UrlToShare="http://www.telerik.com" GoogleAnalyticsUA="UA-XXXXX-YY"
            Width="700" TitleToShare=".NET UI Controls, Reporting, Visual Studio Tools, Agile Project Management, Automated Testing, ASP.NET Web CMS by Telerik">
            <MainButtons>
                <telerik:RadSocialButton SocialNetType="ShareOnFacebook"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="ShareOnTwitter"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Blogger"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Delicious"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Digg"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="GoogleBookmarks"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="LinkedIn"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="MySpace"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Reddit"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="StumbleUpon"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Tumblr"></telerik:RadSocialButton>
                <telerik:RadLinkedInButton CounterMode="Horizontal" ShowZeroCount="true"></telerik:RadLinkedInButton>
                <telerik:RadFacebookButton ButtonType="FacebookLike" ButtonLayout="ButtonCount"></telerik:RadFacebookButton>
                <telerik:RadFacebookButton ButtonType="FacebookSend"></telerik:RadFacebookButton>
                <telerik:RadTwitterButton CounterMode="Horizontal"></telerik:RadTwitterButton>
                <telerik:RadGoogleButton AnnotationType="Bubble" ButtonSize="Medium"></telerik:RadGoogleButton>
            </MainButtons>
        </telerik:RadSocialShare>
        <h2>GoogleAnalyticsUA="UA-ZZZZZ-YY"
        </h2>
        <telerik:RadSocialShare RenderMode="Lightweight" ID="RadSocialShare3" runat="server" OnFacebookLike="OnFacebookLike"
            OnFacebookUnLike="OnFacebookUnLike" OnTweet="OnTweet" OnGooglePlusOneOff="OnGooglePlusOneOff"
            OnGooglePlusOneOn="OnGooglePlusOneOn" OnFacebookSend="OnFacebookSend" OnSocialButtonClicked="OnSocialButtonClicked"
            OnLinkedInShare="OnLinkedInShare" UrlToShare="http://www.telerik.com" GoogleAnalyticsUA="UA-ZZZZZ-YY"
            Width="700" TitleToShare=".NET UI Controls, Reporting, Visual Studio Tools, Agile Project Management, Automated Testing, ASP.NET Web CMS by Telerik">
            <MainButtons>
                <telerik:RadSocialButton SocialNetType="ShareOnFacebook"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="ShareOnTwitter"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Blogger"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Delicious"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Digg"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="GoogleBookmarks"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="LinkedIn"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="MySpace"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Reddit"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="StumbleUpon"></telerik:RadSocialButton>
                <telerik:RadSocialButton SocialNetType="Tumblr"></telerik:RadSocialButton>
                <telerik:RadLinkedInButton CounterMode="Horizontal" ShowZeroCount="true"></telerik:RadLinkedInButton>
                <telerik:RadFacebookButton ButtonType="FacebookLike" ButtonLayout="ButtonCount"></telerik:RadFacebookButton>
                <telerik:RadFacebookButton ButtonType="FacebookSend"></telerik:RadFacebookButton>
                <telerik:RadTwitterButton CounterMode="Horizontal"></telerik:RadTwitterButton>
                <telerik:RadGoogleButton AnnotationType="Bubble" ButtonSize="Medium"></telerik:RadGoogleButton>
            </MainButtons>
        </telerik:RadSocialShare>
    </div>
    <qsf:EventLogConsole ID="EventLogConsole2" runat="server" AllowClear="true"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?