I have a webpage where it has its own search form that is using the "q" as the GET parameter, when a user try to use that search if there's no result found on that search, I will display the Google Custom Search and let them Google instead. However, when my URL is mydomain.com/?q=test , the Google Custom Search will autopopulate its search field as "test" and trigger the Google search result as well on the same webpage.
I prefer Google custom search not to be autopopulated because I am afraid if this break the adsense policies. But I can't avoid it, my webpage already been using the "q" as parameter, it's not an option for me to change to another parameter.
So does that break adsense policy, if so, how to avoid autopopulate ?
Thank
You can change the default query parameter from the control panel at Search features > Advanced > WebSearch Settings > Query Parameter Name.
See https://support.google.com/programmable-search/answer/3037004
Related
I'm trying to retrieve the web page content of Bing Images for a specific query.
I'm currently communicating with Bing through the following URL (in case of a sample foo search), from curl command line tool:
curl http://www.bing.com/images/search?q=foo
Since the safe search filter is enabled by default, I'd need to disable it.
How can I do that?
I know that direct API access would be preferable, but I need to bypass them and retrieve the entire web page.
I saw that from the web page, the safe search is disabled through Ajax calls.
What URL should I contact to make a search with safe search disabled?
The correct solution is to use the query parameter safeSearch=off, like
curl http://www.bing.com/images/search?q=foo&safeSearch=off
This is not documented anywhere I could find.
Add &adlt_set=off to the Bing Search url to close SafeSearch.
&adlt_set=moderate to filter adult images and videos but not text from your search results.
&adlt_set=Strict to filter out adult text, images, and videos from your search results.
The solution is simply to add &safesearch=off to the search URL.
I'd like to know how active are the users depending on the source/medium/campaign of the traffic they came from before sign up. I'm hitting wall when trying to get campaign/source/medium for the current visit from Google Analytics tracker in JS.
I found this tracker.get() method: https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference#get but they don't specify what are the possible values for 'fieldName'. I inspected the tracker object in Firebug and found out the screen attached screen grab:
Are these the only fields that I can query? Is reading any of the campaign fields possible? I understand that GA intends to be anonymous, but I figured this information is not really a secret...
If I can't retrieve this information from GA tracker, how would you approach this question? Should I set my own cookie whenever there's a visit with utm_ parameters and then read it if the visitor chooses to sign up?
I'm aware of this response: How do I extract Google Analytics campaign data from their cookie with Javascript? but a comment says parsing a cookie won't work for AdWords traffic..
I had to do something similar for a project. You need to think outside of the box to get this working. This will only work for cases where you put the campagn information in the url, for tagged url's.
1) On every page add server side code(php, asp .net) to parse the querystring and save the campagn/source/medium from the url in a session(or cookie)
2) Retrieve this information where you need it and process it.
You indeed need some custom javascript in order to achieve this.
I created an open source project for this that addresses the need quite simply:
https://github.com/ilkkapeltola/visitdata
Once you include the javascript library, you can call visitdata.get() and it'll return an object with things such as source, medium etc.
I'm trying to build a Chrome extension and clearly I'm a n00b.
I want to display some links on the right side of Google's result page, based on the query the user has searched.
But I'm just not able to get hold of the user query string!. I cannot depend on parsing URL since, the URL remains the same even though the user has made a second search. Let me clarify with a use case:
User enters a search query "testing time" via omnibox and clicks on
enter. URL has now become
"https://www.google.co.in/search?q=testing+time"
Now from within the results page, user changes the query to "testing again" and clicks on enter. The URL will remain what it was earlier, "https://www.google.co.in/search?q=testing+time".
How then shall I get hold of the query string?
For the case 2 mentioned by you, you should see #q=testing+again at the end of the URL.
You can get it via
location.hash.split("=").pop(); //you might have to unescape it
OR alternatively you can read the new query from the text box itself. (I would prefer this method)
document.getElementsByName("q")[0].value
Is it possible to obtain the search query from Google search results page, given the page's URL? I've noticed that the search query is usually shown in the URL, but the format of the URL can sometimes be slightly confusing.
For example, one search results URL for the search stackoverflow is
https://www.google.com/webhp?hl=en&tab=ww#hl=en&tbo=d&sclient=psy-ab&q=stackoverflow&oq=stackoverflow&gs_l=hp.3..35i39l2j0l2.920.3338.0.3436.13.12.0.0.0.0.310.1216.10j1j0j1.12.0.les%3B..0.0...1c.1.3.psy-ab.OH00abu0aqs&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&bvm=bv.42452523,d.dmQ&fp=8bb62755c027473d&biw=1366&bih=631
Another URL for the same search string is
https://www.google.com/search?btnG=1&pws=0&q=stackoverflow.
Would there be any way to obtain the Google search query from all types of Google search result URLs using JavaScript?
Usually the search term is the URL parameter 'q' of Google.
Check here on how to do this Extract keyword from Google search in Javascript
The primary interface to a site we're building is a jQuery UI auto-complete search box. Users enter some keywords, select the result and are redirected using location.href to their selected page.
All the searches are being tracked properly (_gaq.push(['_trackPageview','/?s=' + current_term']) before the redirect but the destination page is never logged. All the destination pages are set to / in GA.
I've looked but can't find a way to explicitly set the destination before the redirect. Do you have any ideas?
Thanks in advance.
It could be due to the fact that
_gaq.push(...)
is asynchronous. And then you're calling a redirect with window.location stopping code execution.
A solution could be to attach a callback function when calling _gaq.push:
_gaq.push(['_trackPageview','/?s=' + current_term], function() {
// redirect user here...
// window.location = ...
})
Do you have internal search configured in GA?
It's possible that your searches are being logged but the parameter being stripped out from the url on the top pages report.
In that case you should be able to see the data on the internal search keyword reports.
If that's the case and If you still want the parameter to show up in the top page report than you need to uncheck the checkbox on the profile configuration that defines if the search parameter is stripped out from the url.