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
-
Huge Analytics discrepancy when I turned off Analytics Module & Turned on GA via GTM
Hello, I was running universal GA via a GA Drupal module. We setup Google Tag Manager and setup a GA tag to run through GTM. When we pushed the GTM container live our Real Time was at around 1900 and when we turned off the Drupal module the Real Time was reporting around 1100. After 24 hours the sessions for that day were about 100k lower than what they usually are. Any ideas Why the larger discrepancy? Any places that are obvious to look? *I didn't setup the original Drupal GA module, nor do I know who did. Thanks
Reporting & Analytics | | JJLWeber0 -
Universal Analytics Ecommerce Tracking in Magento
We have a problem similar to this: http://stackoverflow.com/questions/22229312/universal-analytics-could-not-track-transaction-in-magento On a client's website. I need an absolute knock-out EXPERT at solving this to give us a quote on doing something like this. It's very urgent but it is paid. Basically the site used the old tracking code, worked, then client said they wanted new data so we upgraded to Universal. Now everything works but Ecommerce tracking. Desperately need help! Thanks all!
Reporting & Analytics | | MattAntonino0 -
Linking Multiple Niche Site In Same Google Analytics Account
Hi, I am providing SEO for Local business. Is it advisable to separate out the Google Analytics into different Google account or is it ok to remain it this way? Some of the client might be in the same niche, and might be competing with the same keywords as well. What I was worried is, Google might see these sites as same owner and only rank for 1 of the site. I was thinking to get the owners to register for their own Google Analytics and share the access to me.
Reporting & Analytics | | JonathanSoh0 -
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 Goals are not recording
Hello! I've set up Goals within Google Analytics and they aren't registering. I'm wondering if someone can review what I've set up to see if I've entered something wrong. I'm trying to track enrollments. Here's the site info: Enroll URL: http://www.careplusdentalplans.com/individuals/enroll-careplus/ Upon completion, the user goes to a Thank You page and our CMS generates a trailing URL parameter. For example: http://www.careplusdentalplans.com/index.php/individuals/enroll-careplus-thank-you/#123456789 My Goal info in GA: Goal URL: /individuals/enroll-careplus-thank-you/
Reporting & Analytics | | SmileMoreSEO
Match Type: Head Match (to disregard trailing URL parameter)
Goal Funnel: Step 1: /individuals/enroll-careplus/ I'm curious if the problem lies in either: The URL: Notice how the URL adds /index.php/ on the thank you page. In that case, should I enter the full URL in the Goal instead of the truncated URL? The Funnel: Is it necessary to show the initial Enroll page or if I'll see that in the Flow Visualization regardless? Thanks in advance for helping me out. Erik0 -
Localhost:4444 Showing Up in Google Analytics
Hello All, Lately in my Google Analytics account I have noticed a referral source labelled: localhost:4444 The number of visits is really high from this source, but I have no idea (no clue!) what it actually means. Can anyone shed some light on what this is about? Should I be creating some sort of filter to screen out this as a referral source (assuming it is not legitimate)? Many thanks in advance. Cheers!
Reporting & Analytics | | Robert-B0 -
Google Analytics data - Canonical problems?
Hi everyone, We're trying to determine why Google Analytics is showing multiple versions of the same page as having "landing page traffic". For instance, these 2 pages are both shown as landing pages in GA: www.oursite.com/product_page
Reporting & Analytics | | darkgreenguy
www.oursite.com/product_page/ This occurs many times in Google analytics. Also, there are instances such as these: www.oursite.com/index.php/custom_product_url www.oursite.com/custom_product_url I can't find anything in Google Webmaster tools that would indicate a problem. However, this GA data is making me think there are duplicate content issues on the site... Thanks in advance for any help...0 -
Google Analytics Organic search queries aren't being updated, even though I'm still seeing results in all our typical results pages.
We pushed some new changes to the site and Google Analytics is no longer updating the Organic Search queries listing, even though traffic is consistent and and we're still landing results in all our typical keyword searches. Any ideas?
Reporting & Analytics | | unclekaos0