How to get Rich Snippet results using Custom Search - rich-snippets

The following query in Google returns the price of the product:
site:elcorteingles.es "4242005059898"
See screenshot of the query in Google
When I make the query through Custom Search the price is not shown in the results.

Related

How to get a podcast episode by its id in the iTunes API?

https://podcasts.apple.com/us/podcast/all-in-with-chamath-jason-sacks-friedberg/id1502871393?i=1000538031954 is a podcast episode. Its ID is: 1000538031954.
I'd like to get this episode's info and metadata through the lookup API.
I tried making this API call
https://itunes.apple.com/lookup?id=1000538031954&media=podcast&entity=podcastEpisode
but it returns no results. I'm wondering if there's a way to do that, or is my only option to scrape the url and get the info myself?
Only the show information is available in this API. You can see the media entities that are available in table 2-1 from the documentation: https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/iTuneSearchAPI/Searching.html#//apple_ref/doc/uid/TP40017632-CH5-SW1

Google CSE (Custom Search Engine) custom query parameter shows no result

So I was trying to link Google CSE to Google Analytics. However, the "Search Terms" in the GA shows funny cache link. I actually expect the search queries by the users here.
According to this StackExchange answer, it is because the cached results use the same query parameter used in CSE, which is q.
So I'm thinking of changing the query parameter of the CSE in the control panel. Note: I'm using the "Google hosted" layout.
This works, and now the CSE link uses query as the parameter instead of q. However, there is no result shown. It seems that search results only appear when the parameter is q.
Does anybody know how to make the results come up using custom query parameter name?
At the end of the day, I just want to get the search terms in my Google Analytics.
Edit:
You can try this snippets with CSE that I set up for Reddit.
https://jsfiddle.net/kd4wjfeg/4/
Note that if you change the query to q in the URL, the results will show up. I've set up the CSE settings to use query as parameter name, as shown in screenshot above.
You need to customize the search box with the correct attribute:
https://developers.google.com/custom-search/docs/element#supported_attributes
For your example you need:
<div class="gcse-searchbox" queryParameterName="query">
Along with other attributes

Get all categories, custom field values in Wordpress query?

I've setup an API endpoint on a Wordpress site I'm working on, but the posts I'm retrieving have quite a bit of associated data, I think doing a query to get the posts then running the posts through a loop and getting this data will be too intensive, is there a catch all that can get all meta data at the same time as getting the posts?
If you're using REST API, you can use the function register_rest_field to add fields to responses. And then you can query all custom fields to put them in the responses.
If you're using a plugin like Meta Box to create custom fields, then you can use its free extension MB REST API to pull all the custom fields into REST API responses for you.

WordPress REST API Global Search (API V2)

I am looking for a way to run a global search query across all or multiple post types using WP REST API.
I am able to search posts using:
http://example.com/wp-json/wp/v2/posts?search=test
In turn I am able to search pages using:
http://example.com/wp-json/wp/v2/pages?search=test
How do I search across both posts and pages? I was able to do this in WP REST API V1 by specifying multiple type[] variables in the query?
This might be a bit late but there is an endpoint for that in the v2-api: /wp-json/wp/v2/search.
You can search for any specific post_type by supplying it via subtype or leave it to the default (any) to search in all post_types.
Edit: Of course you can also specifiy multiple with an array as you did before.
Here are some examples using the REST API search endpoint for searching all content or specific content type(s).
Search For a Term in All Site Content
/wp-json/wp/v2/search/?search=searchterm
Search For a Term and Limit Results to a Custom Post Type
/wp-json/wp/v2/search/?subtype=book&search=searchterm
Search For a Term and Limit Results to multiple Custom Post Types
/wp-json/wp/v2/search/?subtype[]=book&subtype[]=movie&search=searchterm
REST API Search Result Documentation

Linking User Type To Data In Google Analytics

I'm working with linking a user type to a particular field in google analytics. For example, if I want to know the top search words from the user type "Customers", I'm creating a custom report in GA and adding in the fields like search word along with the custom dimension (user-type). But the search word is not being linked to a particular user type.
Is there any way of knowing that a search word came in from this user type ? Does google do that internally or do we have to some how link which search words came from which user types?
If the User type is a dimension in the reports, you can use a new segment in the Overview of Site Search and use a Condition that includes in the report only the type "Costumers".
The report with this filter will only show data, as search term, from these specific type of user.
Hope I've helpd.

Resources