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
-
When Deployment done for my site in google analytic page views little bit affected
Hello Expert, For my ecommerce site every minute I have 500 visitors now when my development team do deployment like minor JS update where site restart not require then what I found is on website (front end) not able to find anything happen that means visitor not event realize page even refresh but in analytic real time it shows minor pageviews down. So can anyone guess here what happen actually in this case as per google? Thanks!
Reporting & Analytics | | micey1230 -
Why would on-site search queries show up as referral traffic?
The site analytics have been set up for over a year and suddenly last month there was a huge spike in referral traffic (1100+ sessions). Upon further investigation, the majority of it was coming directly from internally, either as mysite.com or search.mysite.com and the landing pages from the referrals are all /search.html?query=* This was never an issue before so I'm trying to understand what could have changed. I'm following up with the client to find out if their dev team may have changed anything related to their search engine but I'm wondering if there may be another explanation. A few notes: previously mysite.com / search.mysite.com were not in the Referral Exclusion list. I've added them now but this was never an issue before. Thanks in advance!
Reporting & Analytics | | SEMnMs0 -
Does the new Google Analytics Search Console Beta tool use API to pull more data?
So my client has been asking for definitive proof of why the search query data provided on Google Search Console does not exactly match up the data presented directly in the Search Console itself. The simple answer is that the Google Search Console is limited to 1000 rows of data. However our client is requesting a Google article/documentation of why the new Search Console beta tool has no row limit (hence much more data for a big website). I know that the Google Search Console API was available before Google announced the new Search Console Beta tool in Google Analytics. I also know this API could pull in more data than the 1000 row limit. However is there any article available (preferably from Google) that Google Analytics is pulling this Search Console data via API? Thanks!
Reporting & Analytics | | RosemaryB0 -
Tracking repeat buyers Universal Analytics
Hi there, I want to track the repeat buyers on my ecommerce. In order to do that, I am going to create a custom dimension on Analytics. The custom dimension will be called "repeat_buyers" with scope user because I want to track the user over time. Is my assumption correct? How would you you set it up? When I have this dimension, I would just apply the default metric transaction on my reports. I don't have experiencie on custom dimensions so I might be totally wrong. Can you please help? Thanks and regards
Reporting & Analytics | | footd0 -
Dip in traffic from Pune for our sites in Google Analytics
Hi, We have noticed dip in traffic from Pune after 6th May'14 in our Google Analytics account for few of our sites. Did anyone noticed the same for your site. Kindly let me know if you have any idea. Thank and Regards
Reporting & Analytics | | vivekrathore0 -
Does Google Analytics parse visits from search apps?
Does anyone know if Google Analytics reports visits to your website differently from individual search apps like Google and Bing? Or do they just treat them the same as any other keyword visit from Google or Bing search engine? I suppose the end result is probably the same as in the Google app you're using Google so it would just be a different access point versus a new tool. I'm just curious if there is a way to see how many Mobile visits are coming from the apps vs the browser. For me personally I have the Google and Bing iOS apps installed but rarely use them, opting for the Safari search bar 99% of the time.
Reporting & Analytics | | nsauser0 -
Different metrics in analytics and adwords
Hi. My adwords campaigns and analaytics reports shows me slightly different results. Even for paused or disapproved ads in adwords, the analytics shows me some clicks?! I have automatic tracking enabled. Is it some kind of fault in configuration or its normal? Thank you for answer/link with answer.
Reporting & Analytics | | asystematic0 -
Un-link Google Analytics
I have set the wrong account/password details for one of my campaigns. How do I 'step back' and choose the correct settings please? Thanks Ian
Reporting & Analytics | | driansmith0