Analytics
6K members online now
6K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Unable to track tab clicks and internal page clicks

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I am trying to track tab clicks using a function but i debugged it it is running my GA code but its not being tracked in Google Analytics. Samething is happening with the internal page clicks. Could you please help me in this?

 

Thanks,

Ravindra

1 Expert replyverified_user

Re: Unable to track tab clicks and internal page clicks

Top Contributor
# 2
Top Contributor
Hi,

Can you post a link to the page where you set this up so we can look into it?

Thanks

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Unable to track tab clicks and internal page clicks

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thank you Arnold for your response. It is still not in outside world, i am checking on my local. I will give you the code lines that i am calling:

ASPX Page function call:
------------------------------
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
MultiPageID="RadMultiPage1" Skin="Web20" OnTabClick="tabClick">

Code behind function calling GA
---------------------------------------------------

Protected Sub tabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs)

Try
' 20160513 - JJW - Policy Alerts - Phase 2
Select Case (e.Tab.Text)
Case cConstants.PAR_CANCEL_REPORT_FINAL_CANCELS
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Final Cancels', 'Final Cancels tab on Cancels Report', 'Cancels Report Screen');", True)
Case cConstants.PAR_CANCEL_REPORT_NON_PAYMENT_CANCELS
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Non-payment Cancels', 'Non-payment Cancels tab on Cancels Report', 'Cancels Report Screen');", True)
Case cConstants.PAR_CANCEL_REPORT_UNDERWRITING_CANCELS
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Underwriting Cancels', 'Underwriting Cancels tab on Cancels Report', 'Cancels Report Screen');", True)
Case cConstants.PAR_CANCEL_REPORT_POLICIES_IN_LAPSE_PERIOD
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Policies In Lapse Period', 'Policies In Lapse Period tab on Cancels Report', 'Cancels Report Screen');", True)
End Select
Catch ex As Exception
cLogUtility.LogError("PARCancels", "tabClick", Request, ex)
End Try

End Sub


And also in the below code that the first two select statements are running but nothing is tracked in GA wheres the other three are working as i am assuming the other three are redirecting to a different page but the first two are internal clicks. Any idea?





Select Case e.Item.Text
Case cConstants.MENU_NON_PAYMENT_CANCEL_ALERTS
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Non-Payment Cancel Alerts menu', 'Non-Payment Cancel Alerts menu in Header', 'Header');", True)
oBWPUtility.GetDateRange("NEXT7DAYS", dtStartDateNPC, dtEndDateNPC)
Response.Redirect("~/PolicyActivity/Cancels.aspx?" & cConstants.URL_DATERANGE & "=NEXT7DAYS&" & cConstants.URL_RPTFROM & "=" & dtStartDateNPC.ToString("MM/dd/yyyy") & "&" & cConstants.URL_RPTTO & "=" & dtEndDateNPC.ToString("MM/dd/yyyy") & "&" & cConstants.URL_TYPE & "=" & cConstants.CANCEL_TABS.PENDING_CANCELS, False)
Case cConstants.MENU_UNDERWRITING_CANCEL_ALERTS
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Underwriting Cancel Alerts menu', 'Underwriting Cancel Alerts menu in Header', 'Header');", True)
oBWPUtility.GetDateRange("NEXT7DAYS", dtStartDateUWC, dtEndDateUWC)
Response.Redirect("~/PolicyActivity/Cancels.aspx?" & cConstants.URL_DATERANGE & "=NEXT7DAYS&" & cConstants.URL_RPTFROM & "=" & dtStartDateUWC.ToString("MM/dd/yyyy") & "&" & cConstants.URL_RPTTO & "=" & dtEndDateUWC.ToString("MM/dd/yyyy") & "&" & cConstants.URL_TYPE & "=" & cConstants.CANCEL_TABS.UW_CANCELS, False)
Case cConstants.MENU_SOCIAL_MEDIA_SUITCASE
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Social Media Suitcase menu', 'Social Media Suitcase menu in Header', 'Header');", True)
s = "window.open('" & System.Configuration.ConfigurationManager.AppSettings("FM_SMS_URL") + "', 'popup_window', 'width=800,height=500,left=100,top=100,resizable=yes');"
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", s, True)
Case cConstants.MENU_GROWING_MY_AGENCY
If e.Item.Value = "GMB" Then
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Growing My Agency menu', 'Growing My Agency menu in Header', 'Header');", True)
s = "window.open('" & System.Configuration.ConfigurationManager.AppSettings("FM_GMB_URL") + "', 'popup_window', 'width=800,height=500,left=100,top=100,resizable=yes');"
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", s, True)
End If
Case cConstants.MENU_FIND_MY_MARKETING_REP
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "GA", "GAUniverse('Find My Marketing Rep menu', 'Find My Marketing Rep menu in Header', 'Header');", True)
s = "window.open('" & System.Configuration.ConfigurationManager.AppSettings("FM_FMMR_URL") + "', 'popup_window', 'width=800,height=500,left=100,top=100,resizable=yes');"
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "script", s, True)
End Select


Re: Unable to track tab clicks and internal page clicks

Top Contributor
# 4
Top Contributor
Hi,

Are you trying to track the tab clicks as virtual pageviews or events? I don't see any reference in your tabClick function to a ga send command that would send the hits to GA.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Unable to track tab clicks and internal page clicks

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Here si the javascript for Google Analytics which we are calling

&lt;script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src=g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

var getTrackingId = '<%=GATrackingID %>';
ga('create', getTrackingId, 'auto');
//ga('create', getTrackingId, { 'cookieDomain': 'none' });
ga('send', 'pageview');


&lt;/script&gt;
&lt;script type="text/javascript">
function GAUniverse(category, action, label) {
//alert('Category:' + category);
ga('send', 'event', category, action, label);
}
&lt;/script&gt;

Re: Unable to track tab clicks and internal page clicks

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Any suggestions on this please?

Re: Unable to track tab clicks and internal page clicks

Top Contributor
# 7
Top Contributor
Hi,

Your event tracking code is working. Did you try to debug your implementation using the Google Tag Assistant or GA debugger Chrome plugins?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital