- Action ID
actions.intent.GET_PRODUCT
- Description
- Search and view products or services. Filter products by description, price, and product category
using the
product.description
,product.offers.price
, andproduct.category.name
intent parameters.
Locale support
Functionality | Locales |
---|---|
Preview creation using App Actions test tool | en-US, pt-BR |
User invocation from Google Assistant | en-US, pt-BR |
Example queries
Recommended fields
The following fields represent essential information that users often provide in queries that trigger this built-in intent:
product.category.@type
product.category.author.name
product.category.containsSeason.seasonNumber
product.category.containsSeason.episode.episodeNumber
product.category.name
product.category.publisher.name
product.description
product.offers.price
Other supported fields
The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:
product.@type
product.category.audience.@type
product.category.audience.name
product.category.author.@type
product.category.bookFormat
product.category.containsSeason.@type
product.category.containsSeason.episode.@type
product.category.isPartOf.@type
product.category.isPartOf.name
product.category.publisher.@type
product.offers.@type
product.offers.availableDeliveryMethod
product.offers.leaseLength.@type
product.offers.leaseLength
product.offers.priceCurrency
product.offers.seller.@type
product.offers.seller.name
Supported text values by field
Inventory availability by field
Sample XML files
For information about the actions.xml
schema, see Create actions.xml. For information about the shortcuts.xml
schema, see Create shorcuts.xml.
Handle BII parameters
shortcuts.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<capability android:name="actions.intent.GET_PRODUCT">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<!-- Eg. description = "example product description" -->
<parameter
android:name="product.description"
android:key="description"/>
<!-- Eg. price = "20" -->
<parameter
android:name="product.offers.price"
android:key="price"/>
<!-- Eg. priceCurrency = "USD" -->
<parameter
android:name="product.offers.priceCurrency"
android:key="priceCurrency"/>
<!-- Eg. availableDeliveryMethod = "DeliveryModeOwnFleet" -->
<parameter
android:name="product.offers.availableDeliveryMethod"
android:key="availableDeliveryMethod"/>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.GET_PRODUCT">
<fulfillment urlTemplate="myapp://custom-deeplink{?description,price,priceCurrency,availableDeliveryMethod}">
<!-- e.g. description = "example product description" -->
<!-- (Optional) Require a field eg.description for fulfillment with required="true" -->
<parameter-mapping urlParameter="description" intentParameter="product.description" required="true" />
<!-- e.g. price = "20" -->
<parameter-mapping urlParameter="price" intentParameter="product.offers.price" />
<!-- e.g. priceCurrency = "USD" -->
<parameter-mapping urlParameter="priceCurrency" intentParameter="product.offers.priceCurrency" />
<!-- e.g. availableDeliveryMethod = "DeliveryModeOwnFleet" -->
<parameter-mapping urlParameter="availableDeliveryMethod" intentParameter="product.offers.availableDeliveryMethod" />
</fulfillment>
<!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
<fulfillment urlTemplate="myapp://deeplink" />
</action>
</actions>
Use web inventory
product.description
is a field
that supports web inventory.
In the following example, Google Assistant performs a web search for the user
query and determines the fulfillment URL. Assistant filters for search results
that match the provided urlFilter
value of
https://www.mywebsite.com/link1/.*
.
shortcuts.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<capability android:name="actions.intent.GET_PRODUCT">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<parameter android:name="product.description">
<data android:pathPattern="https://www.mywebsite.com/link1/.*"/>
</parameter>
<parameter android:name="product.offers.price">
<data android:pathPattern="https://www.mywebsite.com/link2/.*"/>
</parameter>
<parameter android:name="product.offers.priceCurrency">
<data android:pathPattern="https://www.mywebsite.com/link3/.*"/>
</parameter>
<parameter android:name="product.offers.availableDeliveryMethod">
<data android:pathPattern="https://www.mywebsite.com/link4/.*"/>
</parameter>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.GET_PRODUCT">
<!-- Use URL from entity match for deep link fulfillment -->
<!-- Example: url = 'https://www.mywebsite.com/link1/item1' -->
<fulfillment urlTemplate="{@url}" />
<!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
<fulfillment urlTemplate="myapp://deeplink" />
<!-- Define parameters with web inventories using urlFilter -->
<parameter name="product.description">
<entity-set-reference urlFilter="https://www.mywebsite.com/link1/.*" />"/>
</parameter>
</action>
</actions>
JSON-LD sample
The following JSON-LD sample provides some example values that you can use in the App Actions test tool:
{ "@context": "http://schema.org", "@type": "Product", "description": "example product description", "offers": { "@type": "Offer", "availableDeliveryMethod": "DeliveryModeOwnFleet", "price": 20, "priceCurrency": "USD" } } { "@context": "http://schema.org", "@type": "Product", "description": "example product description", "offers": { "@type": "Offer", "seller": { "@type": "Organization", "name": "example merchant" } } } { "@context": "http://schema.org", "@type": "Product", "category": { "@type": "TVSeries", "containsSeason": { "@type": "CreativeWorkSeason", "name": "season 3" }, "episode": { "@type": "Episode", "name": "1st episode" }, "name": "TV series title", "publisher": { "@type": "Organization", "name": "network name" } }, "offers": { "@type": "OfferForLease", "leaseLength": "PT20H" } } { "@context": "http://schema.org", "@type": "Product", "category": { "@type": "Movie", "name": "Movie title" }, "offers": { "@type": "OfferForLease", "leaseLength": "PT20H" } } { "@context": "http://schema.org", "@type": "Product", "category": { "@type": "Book", "audience": { "@type": "Audience", "name": "Children" }, "author": { "@type": "Person", "name": "John Doe" }, "bookFormat": "audiobook", "isPartOf": { "@type": "CreativeWork", "name": "Book series" }, "name": "Book title" }, "name": "example name", "offers": { "@type": "OfferForPurchase" } } { "@context": "http://schema.org", "@type": "Product", "category": { "@type": "Movie", "name": "Movie title" }, "offers": { "@type": "OfferForPurchase" } } { "@context": "http://schema.org", "@type": "Product", "category": { "@type": "TVSeries", "containsSeason": { "@type": "CreativeWorkSeason", "name": "season 3" }, "episode": { "@type": "Episode", "name": "1st episode" }, "name": "TV series title", "publisher": { "@type": "Organization", "name": "network name" } }, "offers": { "@type": "OfferForPurchase" } }