Having Issue with Site Search in Analytics
-
Hi Mozzers,
We launched a website in October 2012 and have added in the settings(Google analytics) of that profile "Do Track Site Search" since we have a search box on the website. The site search report worked for 10 days and it was over(from end of december till beginning of January 2013). Since then I have been trying to understand this issue. I have added all the query search terms possible, but still not showing any signs of life.
At this point I am not sure what to do? Some Help would be appreciated!
Search URL= subdomain.example.com**/search/node/**....
Thanks!
-
Hi,
I assume your subdomain is tracking and you are seeing the unmodified search urls in your analytics site content data and it is just the internal site search tracking that is not working?
So in the link above (assuming the js is all correct, I have not tested it) you would need something like this if the search URL looks like: subdomain.example.com**/search/node/keyword**
var s = location.pathname;
var re = new RegExp(“/search/node/([^/]*)/?$”);
var m = s.match(re);
pageTracker._trackPageview(‘/search/?q=’ + m[1]);What you are doing is getting the initial url, then setting up a regex to get anything after /search/node/ (your keywords in other words) and then pushing these keywords into a virtual page view that analytics can understand as a site search query. Worth noting that this code should only be on your search results page, not all pages of the site. if you have a dev environment you can make sure all the variables (s,re,m) are returning what you expect by just alerting them like: alert(s); etc etc.
This should give you virtual pageviews that you can actually see in your analytics site content reports that will look like /search/?q=YOURKEYWORDS, and if you see those then you just need to set up normal analytics site search tracking as you already had with q as your variable.
It may be easier to do it in php or whatever language your site is coded in, the issue is to isolate the search keywords in whatever way is easiest for you and then do the virtual page view in analytics with the pageTracker._trackPageview(‘/search/?q=YOUR_KEY_WORDS');
Hope that helps!
-
Hi guys,
Unfortunately I don't have any programming knowledge so I am having an issue understanding what I need to use as a regex for the javascript modification here
"var s = location.pathname;
var re = new RegExp(“/search/([^/]*)/?$”);
var m = s.match(re);
pageTracker._trackPageview(‘/search/?q=’ + m[1]);
*Assuming the results page is in the format http://www.mysite.com/search/keyword
and further assuming my JavaScript and regex are even remotely accurate – meaning don’t just use this example code and expect it to work, this is to demonstrate the concept only"As I said the search URL looks like: subdomain.example.com**/search/node/keyword**
Thanks for your help
-
thanks Lynn for your answer.
I'll try to follow the details you sent me.
-
Hi,
Lynn is probably right, things don't stop working if nothing changes. If you would be able to share the site with us we can help you out probably.
-
Hi,
If it worked for a few days then something must have changed after that. Maybe you went from a search url looking like /search?q=myterm to something like /search/myterm? To track site search without the query string in the url you need to do a bit of fiddling with analytics to create a virtual page view. See this page for details on setting it up. Worth mentioning also to make sure you are properly tracking your subdomain just in case.
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
-
How do sites without access to a site's analytical data, determine a site's organic traffic?
I've recently used a organic traffic checker that showed you your traffic compared to each google algo update. I was interested in how they derived the organic traffic totals for each month, without having access to our site's google analytics? I've since compared the data to historical google analytics data and it's not wrong, isn't 100% match either but isn't far from fact. So if they're predicting or making a guess, it's rather spot on, site crawlers and SERPs snapshots only provide so much info, I'm just wondering where they get the rest from and how?
Reporting & Analytics | | Deacyde0 -
Need help understanding what happened to our organic search.
I help run an ecommerce business that mainly runs on Google organic search (yes, I realize this is not a good place to be). Last April, we saw around 25-30% of our organic search cut. I’m pretty sure it was due to the mobile update but we had some changes in the past month or two before that. I’m looking for someone to review my analytics account and see what happened. Possibly this is called an audit? Also, we’re looking to ask some questions about long term strategy as we are thinking about a redesign and switching to a new platform. Maybe more content? Maybe more social?
Reporting & Analytics | | kirbyf0 -
Exact Match in Google Search (Not Adwords)
I was going throught the list of keywords that have sent traffic to my site over the last 7 years and cam across one "A516 grade 70" that had hundreds of variants. Now in a lot of cases search volumes were different as were SERPS. We've tested a few variants with reworked pages (70% similar to original but optimised for variant keyword) and see good SERPS and traffic results. Theres obviously some diminishing returns here for us but the interesting question is when to these variants become an exact match and when not? In some cases the variants are unique because of the spacig, periods and hyphens used. there isn't a clear correlation with exact matc though. Insight appreciated. (Sorry for spelling errors. Form doesn't play nicely with iPad)
Reporting & Analytics | | Zippy-Bungle0 -
Funnel Visualization in Google Analytics
Hello. I have a question about funnel visualization in Google Analytics where there is an eCommerce goal (i.e. add to cart, shipping, purchase) with the first step being mandatory. Issue:
Reporting & Analytics | | Unity
The amount of completed purchases reported in GA doesn't match the actual transaction figure via the eCommerce platform. Question:
I was wondering if anyone knows why this occurs? I have a few ideas on why however I haven't been able to locate any supporting evidence. So I was hoping to generate a few ideas from the SEOMoz community to help me investigate further. Any ideas welcome! Much thanks,
Davinia0 -
Omniture vs Google Analytics
What's your opinion on analytics tools? Specifically Omniture vs Google Analytics. Is Omniture really that much more powerful than GA? Have you used GA Premium, the enterprise package? My main question - Can GA (free or premium) do everything that Omniture can? If GA Premium and Omniture were the same price, which would you choose? Is one harder to implement, pull reports, tweak, ect? Thanks in advance.
Reporting & Analytics | | akim260 -
Nofollow page is being reported as a landing page for organic search in Google Analytics
One of my client's websites includes a series of pages for an enrollment process. All of these pages are blocked by robots.txt. In Google Analytics these pages are showing data as landing pages for organic search traffic, and have been for quite some time. There was recently a surge of organic search traffic landing on one of these pages, coming from multiple search engines. The pages appear to be blocked and I'm not finding any of them in the search results for the keywords that are being reported in GA or by searching for the url. Does anyone have any insights into why this might be happening?
Reporting & Analytics | | rgibson1000 -
Google Analytics | REAL TIME
So I noticed today that there is now Real Time Data: http://analytics.blogspot.com/2011/09/whats-happening-on-your-site-right-now.html and I cannot figure out how to access this.
Reporting & Analytics | | joseph.chambers1 -
How do shortened links show up in Google Analytics?
Hey, How do shortened links show up in GA? So if I tweet about something and use bitly, does twitter get the referral? I am thinking not. I have never seen bitly show up as a referrer, but we gets lots of clicks from those links. Hmmmm. Anyone? E
Reporting & Analytics | | ErinTM0