Tracking Social Media Logged In Users Help
-
Hi, I recently read Tom Anthony's post on "Monitor Which Social Networks Your Visitors are Logged Into With Google Analytics". I have looked and re-looked at the code implemented and after two days I am still not getting any results tracking. Could somebody please take a look at my site and tell me if they see any conflicts or errors I may have made when installing the code.
Thanks for any help!
-
If fixing the bracket doesn't work then forcing the variable to be set is probably best done with an event tracker, and not a pageview tracker so it doesn't screw with your bounce rate or your pageview count.
If you look at google's example they follow up their custom variable code with the following code:
_gaq.push(['_trackEvent', 'Shopping', 'Item Removal', ]);
You would want to put that in just below the custom variable lines:
_gaq.push(["_setCustomVar", slot, network + "_State", "LoggedIn", 1]);
You probably want to change the details of the event to say something like:
_gaq.push(['_trackEvent', 'login check', 'successful check', ]);
This event is fairly useless for segmenting as it will get fired off every time the code runs, but it will be sure all of your info gets passed to google.
I wouldn't try this until you try putting the bracket in I mentioned above though.
-
Actually, I just took a look at your code, and I think it is something much simpler.
You somehow deleted the opening "{" after the function call.
Your function declaration code looks like this:
function record_login_status(slot, network, status)
if (status)
it should look like this:
function record_login_status(slot, network, status)** {**
if (status)
The key is that bracket telling JS to start the function.
-
Thanks for this, so tell me, how would you rewrite the code so that it works. Are you suggesting that
_setCustomVar()
should be replaced with_trackPageview()
-
This is probably occuring because you are calling the custom variable function after the main track pageview function. Without another track pageview or event tracking call you aren't ever really passing the data back to google.
The talk about this in the setup guide for using customer variables in the GA help documentation: http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#setup
Scroll all the way down to the bottom and you will see this:
Call the
_setCustomVar()
function when it can be set prior to a pageview or event GIF request.In certain cases this might not be possible, and you will need to set another
_trackPageview()
request after setting a custom variable. This is typically only necessary in those situations where the user triggers a session- or visit-level custom var, where it is not possible to bundle that method with a pageview, event, or ecommerce tracking call.I will put this into the original posts comments as well so he can update his method, or tell me I am wrong
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Do Lot of Tracking via Tag manager Increase Bounce Rate?
Hello Expert, I am doing lots of tracking for my ecommerce site but I am not sure reason for increase in bounce rate as my traffic also increase but I want to make sure that my tracking not affecting my bounce rate. I do tracking via page views, events, custom html, etc so for all the applicable tags Non-Interaction Hit - I set "True" so I am right here? Thanks!
Reporting & Analytics | | dsouzac0 -
How to Configure & Tracking Images in Google Analytic?
Hello Experts, Can anyone tell me for my eCommerce site how to configure images tracking in google analytic? And where can I see the image traffic in google analytic? Not sure I am asking correct question but confuse about image traffic. Thanks! Wrights!
Reporting & Analytics | | wright3350 -
Tracking Product Codes
Hey Mozzers, We are improving our B2B site by adding product codes to headings & meta information etc to gain some traction ranking for our own products and those supplied by others when searched for by product code. Almost immediately we are hitting the top half of the first page for most of these and seeing some nice results. We would like to track our placement for these product codes in google but feel this would be a waste of our Moz Keyword limit and we really dont need to check them once a week, just one a month or so. Has anybody got any methods of tracking our ranking for a a big list of keywords say once a month which isn't too labour intensive? Many Thanks
Reporting & Analytics | | ATP0 -
Tracking Mailto Links Through Event Tracking
Hi I am trying to get event tracking working on some mailto links on a website using Universal Analytics. I've read various resources as nothing seems to mention mailto links. Does it not work on tracking outbound clicks on emails? Thanks in advance.
Reporting & Analytics | | Karen_Dauncey0 -
URL String Tracking Question--Need help!
I am doing some research for a freelance project and found a URL receiving a decent amount of traffic from search with this url string after the normal page url (xxx.com/credit-card-counseling.aspx?match=e&query=debthelper.com&id=22097628847&id=1810807655) Is this some sort of GA tracking code? Why would it be used on that page to track organic search hits if that happens automatically? Would love some help figuring this out! Thanks,
Reporting & Analytics | | RickyShockley0 -
Has anyone experienced Google Analytics track the page visit to a "thank you" page, but not the goal conversion?
Has anyone experienced where Google Analytics would track the page visit to a "thank you" page, but not the goal conversion that should result? The goal had worked for a long time as it is as just a goal url with head match. No funnel. Not case sensitive. For about four days now, no conversions have been recorded, but Google Analytics shows hundreds of people visited the page that should trigger the goal. Additionally, we have received the hundreds of leads. A Screaming Frog search shows the code is embedded throughout the site. For the interested, the GA code looks like (and the 8 Xs are the correct number on the site): Am I missing something?
Reporting & Analytics | | 352inc0 -
What's the final word on Image Search tracking in Google Analytics?
Sorry if this has been answered but I can't seem to get a straight answer to my questions by searching around. How is traffic referred by Google Images counted in Google Analytics? I know it used to be referral traffic from google.com/imgres. A lot of things I have read say that it should all be under google/organic now, but my site still gets referral traffic from google.com/imgres, so that can't be. However I also get traffic as google/organic that I am pretty sure is from image search, because we don't rank for the keyword normally, but we do for image search. What's the deal? How is traffic from an embedded image in a regular result page counted? How can I segment my image search traffic better? It would be great to see image search traffic as it's own medium. I found a script here -- http://jrom.net/google-images-in-google-analytics -- that looks promising, has anyone used it or can recommend another way? I haven't used the GA API very much so I want to make sure the script is kosher and won't screw up my numbers.
Reporting & Analytics | | tact0 -
Is there a way to use Google Analytics event tracking for YouTube embedded videos on my website?
Hello! I am trying to track different types of interaction on the YouTube for videos which are embedded on a website to measure the interaction on these video from my organic traffic. Is there a good way to go about this with the code since these are coming from an iFrame on YouTube? Would appreciate any feedback or help on implementing the event tracking with YouTube videos. Many thanks!
Reporting & Analytics | | CabbageTree0