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
-
Search and Replace filter on Google Analytics?
Hello! On our GA account for one of our clients, we'd like to add a search and replace filter to the Views section of the account. The URL is www.askergoworks.com (it redirects to askergoworks.com), and Google has flagged us to have redundant hostnames. This is why we'd like to add the filter. Would the regular expression be askergoworks.com|www.askergoworks.com ? Any help would be great - I'm not a regex expert, so I really don't how to go about this. Thanks!
Reporting & Analytics | | AGILITY0 -
Google Analytics - Dashboard Question
I'm looking to set up a dashboard widget in Google Analytics that does the following but can't : Shows traffic sources in a table as the dimension, and wanting to show goal completions to a specific product page and then only show what the average time spent (by source) on just those product pages. It looks like it's showing the whole session duration for the entire source, but I want to create a secondary filter that is only showing the time spent on those specific pages. Can anyone help - or is this possible? Thanks all!
Reporting & Analytics | | ReunionMarketing0 -
Something does not add up with WMTs search analytics data
we recently replatformed our main site and switched to https. For the first 2-3 weeks after we moved organic traffic was great, we did not lose any ( increased a little), but then it dropped off significantly. Attached is a screenshot from one of our main keywords that dropped off. You can see click (blue) and impressions (red) dropped off, and the position became unstable, but in the last week it has stabilised to about the same position it was before, but the clicking and impressions are still very low. The keyword is generic (for our industry) and there would not be any major seasonal changes in the search volume. I can't make sense of this data, could be be wrong? Kd3p5f9.jpg
Reporting & Analytics | | PaddyDisplays1 -
Help With Understanding Chrome Web Store Analytics
Hi all, our website Creately is listed in the Chrome Web Store. Its not an extension or an app, but just a link to app which users can use to quickly log into the app and start drawing their diagrams. They do provide you a way to add Google Analytics to track some visitor data like user visits. But we want to figure out from which sections of Chrome Web Store is sending us traffic. When looking at the Source/Medium reports I can see the following. chrome-ntp-icon / (not set) chrome-app-launcher / (not set) chrome-ntp-launcher / (not set) chrome-app-launcher-search / (not set) chrome-app-launcher-info-dialog / (not set) I'm guessing these indicate where we're getting the traffic to the Chrome web store page but I can't seem to find any information about what they mean. Any help will be greatly appreciated.
Reporting & Analytics | | Nishadha0 -
Google Analytics Custom Alert For Goal Completions?
Hi currently setting up custom alerts for a website. I want to do a custom alerts for when goal completions decrease or increase by a certain % e.g. 20% as shown in the third example from this Moz Article back in 2012 - http://moz.com/blog/7-essential-google-intelligence-custom-alerts-that-keep-me-sane However when i go into my GA account the only options seem to be for when the goal completion conversion rate % drops. I could use this, but i rather do just based on completions rather than %. Any ideas on how i can do this? Thanks.
Reporting & Analytics | | MBASydney0 -
Weird Google Analytics tracking question
I have a client that has a market place site, where people list goods and sell them, think something like Etsy. Instead of developing a system to show the users page views and things like that, does it sound reasonable to let them enter a Google Analytics property on the pages they list on, then let them monitor through GA? Does anyone see any fatal flaws in this thinking?
Reporting & Analytics | | LesleyPaone0 -
Google Analytics
Good Morning, I am trying to understand 2 issues in Google Analytics. 1. When look at : Traffic Source --> SEO --> Quesrios - i see the impressions column and its always a whole number 1550, 500, 5500, etc.. I never saw (for example) 702, 313, etc... impressions Can anyone explain why and how does it work? 2. In the same report i see my AVG. position for each query, the question is how come i have AVG, position of (290, 230, 190) for some of the queries and still i get clicks on these queries. My guess is that from time to time these queries have better position and the clicks are from these time. Do you familiar with a way to the the distribution of a specific query over time? for example: 1.3.2013 avg position = 4 2.3.2013 avg position = 7 3.3.2013 avg position = 2 4.3.2013 avg position = 8 etc... 3. This report say its for: "Top 1,000 daily queries" - What does it mean? Thank you and sorry for this long question SEOwiseUs
Reporting & Analytics | | iivgi0 -
How would you measure the SEO success of new site launch?
It has been 12 months, and it is time for some serious SEO reality check up. I think we have done some really nice things (social integration, on page optimization etc) but we honestly could do a million time better on some other elements (anchor, text, link building etc...). Would love to hear from the community what would be the top 10 criteria you would use to judge the quality of the SEO work done for a new site during is first 12 months. PS: we are a very content rich over 1,500 new articles/post in our niche with 12 months - our site is migraine.com Thanks
Reporting & Analytics | | OlivierChateau0