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
-
Help on how to test the DA, PA of the website
Please help me. How to check the DA, PA of the website https://toolaim.com/ . I want to know any quality website to take care of it more. But at present I do not know any forum quality is good and trust. Thank you
Reporting & Analytics | | gogoanimetp0 -
Help Blocking Crawlers. Huge Spike in "Direct Visits" with 96% Bounce Rate & Low Pages/Visit.
Hello, I'm hoping one of you search geniuses can help me. We have a successful client who started seeing a HUGE spike in direct visits as reported by Google Analytics. This traffic now represents approximately 70% of all website traffic. These "direct visits" have a bounce rate of 96%+ and only 1-2 pages/visit. This is skewing our analytics in a big way and rendering them pretty much useless. I suspect this is some sort of crawler activity but we have no access to the server log files to verify this or identify the culprit. The client's site is on a GoDaddy Managed WordPress hosting account. The way I see it, there are a couple of possibilities.
Reporting & Analytics | | EricFish
1.) Our client's competitors are scraping the site on a regular basis to stay on top of site modifications, keyword emphasis, etc. It seems like whenever we make meaningful changes to the site, one of their competitors does a knock-off a few days later. Hmmm. 2.) Our client's competitors have this crawler hitting the site thousands of times a day to raise bounce rates and decrease the average time on site, which could like have an negative impact on SEO. Correct me if I'm wrong but I don't believe Google is going to reward sites with 90% bounce rates, 1-2 pages/visit and an 18 second average time on site. The bottom line is that we need to identify these bogus "direct visits" and find a way to block them. I've seen several WordPress plugins that claim to help with this but I certainly don't want to block valid crawlers, especially Google, from accessing the site. If someone out there could please weigh in on this and help us resolve the issue, I'd really appreciate it. Heck, I'll even name my third-born after you. Thanks for your help. Eric0 -
Subdomain tracking codes on subdomain and not root
Afternoon all. I’m pretty sure this is going to be fine but I thought I would seek some confirmation before I action anything. We have a blog subdomain on our site, I have just noticed that the entire blog (built in Wordpress) has no analytics tracking code on it. As this is built in Wordpress I have just logged in on an admin account I think people forgot I had and added the code to the header section as it is a two second job. My question is this – On the main account, subdomain tracking has not been turned on, so the root domain has not got the additional _gaq.push(['_setDomainName', 'rootdomain.co.uk']); line of code in it. I have included this on the blog.rootdomain.co.uk code as is necessary to enable tracking. Will this work or cause tracking issues? I think it should be ok. I don’t want to have to update the root domain code if I can avoid it as that will need to go through the development team and may take weeks as they are swamped and under resourced. Thanks, Rich.
Reporting & Analytics | | Sarbs0 -
Event Tracking Not Working
Hey there. Could use some help in figuring on why the event tracking code on this site http://www.baltimoreareahondadealers.com is not working. There is code on all external domain links but none seem to be firing. Inspect all the map links to view code ie. Search New Honda Inventory What am I missing? Thanks so much. -Caryn
Reporting & Analytics | | Caryn0 -
Subdomain GA Tracking??
Hi Mozzers I am tracking a web property www.example.com and we are launching a subdomain.example.com. Should the subdomain tracked on GA by creating a new profile or should it be on its own with a new GA property ID? Thanks for explaining how to do that setup 🙂 Ty
Reporting & Analytics | | Ideas-Money-Art0 -
Where do I find Google Analytics link tracking for outbound links?
We implemented this script in source, where would I find the outbound link tracking; in Events?
Reporting & Analytics | | KnutDSvendsen0 -
How to track what people type on my text boxes on Google Analytics?
Hi there! In our website, we have a few text boxes that users need to use to complete the goal. The boxes aren't search boxes, but it's still important to us to track what people type on it. I'm looking for a way to track the data through the "event" feature in Google Analytics, but it seems that this tracker can only calculate clicks, or video views etc. Does anyone knows how to track do it?
Reporting & Analytics | | ivan.precisodisso0