I am a beginner Wordpress developer and am developing a WordPress search plugin with some AI based API involved.
How does plugin work?
User fire some search in search widget
If the query text is identical to AI based API we get some textual result and relevant URL (within site) to redirect the page.
If query text is strange or beyond AI's scope of identification then we invoke search widget submit. By calling 'el.submit()' JS method.
What is the problem?
My plugin is working as expected on the home page. Ex www.example.com
If I search 'Google search console' (Which is an internal article) then search widget invoking the native search and search widget submits the form. URL becomes www.example.com/?s=Google+search+console.
Problem: When I go to www.example.com/blog and fire the same search query then URL becoming www.example.com/blog/?s=Google%20search%20console
Resulting in 'Page not found'.
It is weird. Do somebody had any idea what is happening here or why two different constructs of a search query on relative pages within the site.
Related
I'm using this URL for Google Translate on my website (let's say http://example.com) as a menu item:
https://translate.google.com/translate?js=n&sl=auto&tl=DE&u=http://example.com
After user goes on this page Google shows my website translated in <iframe>.
Since Google overwrites all links in this frame, user cannot go back on the untranslated page.
Is there any method to go back on the original page (http://example.com)?
I'm running a pest control AdWords campaign.
When people click on an ad and get to my main page, the url has a query string that has the service and the town name
It'll be like pestcontrol.com/pestcontrol?service=roaches&town=Beverly
It's important because I draw from this query string to populate the page heading "Looking for [service] in [town]?"
On my main page, they have to choose the pest that they're having trouble with.
Let's say they pick rodents - it'll send them to the rodent page
But I'll lose the query string...
How can I keep the query string so that the next page can be personalized as well?
Is there some way to write a link so it keeps the current query string?
I'm a noob and I'm new to Wordpress and web dev in general so any help is appreciated
Using the German UI of Google Analytics I stumbled upon two dimensions called "Zielseite" and one "Zielseite der Suche"
So switching to English version brought up the following possible dimensions:
Landing Page and Search Destination Page -- no idea what the second "Zielseite" could be.
Using https://developers.google.com/analytics/devguides/reporting/core/dimsmets I found the following API-names:
ga:landingPagePath
UI Name: Landing Page
The first page in a user's session, or landing page.
ga:searchDestinationPage
UI Name: Destination Page
The page the user immediately visited after performing an internal search on your site. (Usually the search results page).
ga:searchAfterDestinationPage
UI Name: Search Destination Page
A page that the user visited after performing an internal search on your site.
So I started some analysis-queries:
metric: ga:sessions
dimensions: ga:landingPagePath,ga:searchDestinationPage,ga:searchUsed
All results had ga:landingPagePath==ga:seachDestinationPage (no matter if ga:searchUsed==Visits With Site Search or Visits Without Site Search)
That's not what I would expect. (155 with Search and 5237 without Search)
So the question is who this dimensions always have the same value and what which one does have the correct value?
Landing page path is the first page of a session coming from anywhere.
Search destination page is for INTERNAL search results. It is not a landing page -- it is the page you went to after you did a search ON the site itself (assumes that the site has a site search capability and that GA is configured to recognize internal search queries).
Sessions are counted ONLY on landing pages, and including search destination page in your query automatically restricts the query to visits site site search only (there is no (not set) value for that dimension - sessions without a value are excluded from the report). Try the query with Unique Pageviews, with and without the search destination page, and without the landing page, then compare.
Welcome to custom reporting in GA....
Does anyone know if/how I can escape the shebang or encode the uri to make a link work properly in google analytics url builder? I want to add campaign parameters to product page urls to track ads success. The url for each individual product page looks like this:
http://www.oursite.com/classic-movies/#!/Title-of-Movie/p/12345678
When I put the product page url into the url builder, it says the url is invalid. I think it is because of the #!. I have tried escaping out the special characters, replacing the shebang with %23%21 or %21!
It appears valid in the url builder, and the builder generates a link with utm tags, BUT when you paste the tagged link into the browser, it does not take you to our product page. It takes you to our website, but gives a "sorry does not exist" message.
I also tried this:
http://www.oursite.com/classic-movies/?_escaped_fragment_=/Title-of-Movie/p/12345678
It generates a link in the builder and does link to the product page of our website (yay!), but the url adds this after the campaign name: #!/Title-of-Movie/p/1234567
The shebang is back! Will that be a problem?
For reference, we're using the Ecwid storefront plugin for a wordpress site.
Thanks in advance.
Short answer
You should use the URL without fragment (hash part) as a base for building URLs with queries (the part starting with '?') and then append the hash part to the end of URL.
Example:
1) Take http://www.example.com/classic-movies/#!/Title-of-Movie/p/12345678
2) Remove hash part: http://www.example.com/classic-movies/
3) Use this hash-free URL as a base and add query parameters yourself or use any automatic builder. Example: http://www.example.com/classic-movies/?utm_source=myblog&utm_campaign=xyz&abc=def
4) Append the hash part to the end of the URL: http://www.example.com/classic-movies/?utm_source=myblog&utm_campaign=xyz&abc=def#!/Title-of-Movie/p/12345678
You're done – the final URL is valid URL which will work fine for browser/customer, your site server and tracking tools like Google Analytics
Long answer
1) URLs could be very different, but their structure is actually quite the same and that's a part of the web standards.
URL is built this way:
protocol://site/path?query#fragment
(I simplified it and take in consideration only the parts we're talking about, the actual scheme is a bit more complicated)
Taking your product page URL, that will be:
protocol: http
site: www.example.com
path: classic-movies/
query: (empty)
fragment: !/Title-of-Movie/p/12345678
Now, if you want to add query parameters, you know where to insert them. As to the fragment part, it should be always in the end, regardless of whether it contains !
2) Google Analytics doesn't track the fragment parts of the URLs.
Urls like http://www.example.com/coolpage and http://www.example.com/coolpage#!anyparameter=anyvalue are the same for Goolgle Analytics. That's likely the reason why their URL builder tool doesn't accept that.
By the way, Ecwid uses fragment part of the URL all the time to address the product and category pages, but that's not an issue if you want to track your product pages in Google Analytics. Ecwid solved that problem by sending special 'virtual' page views to Google Analytics every time a customer browses your store. So in your GA reports you will see your store pages.
3) If you use Google Adwords for your ad campaigns, I'd suggest linking your Google Analytics and Google Adwords profiles to have better picture of customer behavior and the campaign performance. Check out this thread on Ecwid forums for the details:
http://www.ecwid.com/forums/showthread.php?t=10835
I am trying to build a locally-based restaurant listing/reviews site. I can't help but notice that if I search for a restaurant on the web that sites like Yellow Pages or Yelp have a listing that appears at the top of the list for that restaurant. Obviously they don't have a separate web page for every restaurant in the US, but somehow their database of info is being read by the search engine. How is that accomplished?
Thanks in advance.
The information is stored in a database, and a template page just pulls up the information from the database and displays it. The URL appears to be a unique page for the restaurant by clever use of URL re-writing or, in .NET, using routing.
Routing basically takes a GET parameter from the url, incorporates it into the URL as a pseudo-path, then uses that parameter to get the database record to display the restaurant.