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
-
Google Search Console
To the Moz Community, Should we be considering the information that Google Search Console is telling us? It is showing a dramatic drop in our SEO and our pages are not being indexed, however it is showing differently in our Moz Analytics section. Any clarification will be greatly appreciated. Many thanks Dawn
Reporting & Analytics | | DawnQ0 -
Google Analytics Real Time Not Working! :(
Hello Everyone, Today, the real time feature in my google analytics stopped working. I am able to see that traffic is visiting my site, but not in real time. The real time count is usually at 0. But, there are some instances where real time will come back online, but there will be only 1 unique visitor. At any given time, our website usually has 20 visitors or so..Has anyone encountered this issue? Where should i start looking for fixes? What are the possible problems? Thanks!
Reporting & Analytics | | KarlMarxTheBear0 -
How would I create this type of report in Google Analytics?
I work for an e-commerce site. I would like to run a weekly report to see what every category pages increase and decrease for pageviews would be. How would I do that?
Reporting & Analytics | | EcommerceSite0 -
SEOing a Site Before it is ready?
Hi Guys I have a site currently being built that is 45 days away. I am wondering whether it is possible to have a dummy website (with same domain name) in play and starting the SEO effort so that these 45 days are not wasted from an SEO point of view. Is this something you have seen done effectively, or is it a no no. Kind Regards, Justin
Reporting & Analytics | | jchapman50 -
Any harm and why the differences - multiple versions of same site in WMT
In Google Webmaster Tools we have set up: ourdomain.co.nz
Reporting & Analytics | | zingseo
ourdomain.co.uk
ourdomain.com
ourdomain.com.au
www.ourdomain.co.nz
www.ourdomain.co.uk
www.ourdomain.com
www.ourdomain.com.au
https://www.ourdomain.co.nz
https://www.ourdomain.co.uk
https://www.ourdomain.com
https://www.ourdomain.com.au As you can imagine, this gets confusing and hard to manage. We are wondering whether having all these domains set up in WMT could be doing any damage? Here http://support.google.com/webmasters/bin/answer.py?hl=en&answer=44231 it says: "If you see a message that your site is not indexed, it may be because it is indexed under a different domain. For example, if you receive a message that http://example.com is not indexed, make sure that you've also added http://www.example.com to your account (or vice versa), and check the data for that site." The above quote suggests that there is no harm in having several versions of a site set up in WMT, however the article then goes on to say: "Once you tell us your preferred domain name, we use that information for all future crawls of your site and indexing refreshes. For instance, if you specify your preferred domain as http://www.example.com and we find a link to your site that is formatted as http://example.com, we follow that link as http://www.example.com instead." This suggests that having multiple versions of the site loaded in WMT may cause Google to continue crawling multiple versions instead of only crawling the desired versions (https://www.ourdomain.com + .co.nz, .co.uk, .com.au). However, even if Google does crawl any URLs on the non https versions of the site (ie ourdomain.com or www.ourdomain.com), these 301 to https://www.ourdomain.com anyway... so shouldn't that mean that google effectively can not crawl any non https://www versions (if it tries to they redirect)? If that was the case, you'd expect that the ourdomain.com and www.ourdomain.com versions would show no pages indexed in WMT, however the oposite is true. The ourdomain.com and www.ourdomain.com versions have plenty of pages indexed but the https versions have no data under Index Status section of WMT, but rather have this message instead: Data for https://www.ourdomain.com/ is not available. Please try a site with http:// protocol: http://www.ourdomain.com/. This is a problem as it means that we can't delete these profiles from our WMT account. Any thoughts on the above would be welcome. As an aside, it seems like WMT is picking up on the 301 redirects from all ourdomain.com or www.ourdomain.com domains at least with links - No ourdomain.com or www.ourdomain.com URLs are registering any links in WMT, suggesting that Google is seeing all links pointing to URLs on these domains as 301ing to https://www.ourdomain.com ... which is good, but again means we now can't delete https://www.ourdomain.com either, so we are stuck with 12 profiles in WMT... what a pain.... Thanks for taking the time to read the above, quite complicated, sorry!! Would love any thoughts...0 -
Google Analytics - Not provided info
Morning all, i am using Google analytics for some time now, One of the issues that i don't have a clear answer for is, when i am looking at Traffic Source --> overview In the Keyword column, that is a line (not provided) What we think here is that we cant see the keywords if someone arrived to our website but was logged-in to Google account Is this correct? is there a way to find the keywords behind this (not provided)? - i have many visits for this line (17.3% of all visits) and i don't know which keywords people used. Thank you SeoWise
Reporting & Analytics | | iivgi0 -
Google analytics settings
Hi I have GA installed, whaen I try to use Inpage Analytics, I get this message: We've identified problems in your setup. These may cause problems loading In-Page Analytics. Error: The Website in your settings (http://www.tvorba-logo-firmy.sk) redirects into a different domain. (http://tvorba-logo-firmy.sk). In-Page Analytics currently works on only one domain. Note that www.example.com and example.com are NOT considered to be on the same domain. Also, make sure you're not redirecting from http:// to https:// or vice versa My website is running on wordpress. Thanks for help.
Reporting & Analytics | | info_tipovanie-stavkovanie.com0 -
Google Analytics Queries
Hi we used a web company who put our analytics under their company name we have left them and set up a new tracking code not associated with them, but we still have access to the data and it is all contained under the same login, is it possible to merge the two tracking codes? so that we have seemless history. Also does anyone know if you can change the primary e-mail address (gmail account) to a corporate email account? Any help would be appreciated as we have researched both and from what we have found we can't merge the data and also we are stuck with the primary email address.
Reporting & Analytics | | loopylu030