Product collections let you define groups of products to use with rich formats, such as Shoppable Images . Each collection can include up to 100 products. You can create a collection with either the Google Merchant Center or the Content API.
This guide shows how to use product collections through the Content API, including examples for how to create a collection for Shoppable Images and how to check the status of a collection.
Use product collections
The Content API includes two services to manage product collections:
-
collections
: Lets you get, list, insert, and delete product collections. -
collectionstatuses
: Lets you get and list the status of collections to discover whether a collection has any issues that may cause the collection to be invalid for a destination, such as Shopping Ads .
Example: Create a collection for Shoppable Images
Shoppable Images
are high-
quality images which show one or more annotated products, and are configured
using collections. To use Shoppable Images, you must specify values for the imageLink
and featuredProduct
fields, in addition to the fields required for
all collections. For more information about required fields, see the Content API reference documentation
.
To use Shoppable Images, you must create a collection of products and use the imageLink
field to specify an image that contains up to ten products. We
recommend using square images (with a 1:1 aspect ratio).
You must also specify the products displayed in the image using the featuredProduct
field, including the coordinates of the products in the image
using the x
and y
fields. These fields are only required for collections
used with Shoppable Images. The x
and y
values must be between 0 and 1,
inclusive.
Each collection can include a maximum of 100 products. However, for
Shoppable Images, we recommend that you specify coordinates for no more than 10
products per image to ensure that there is enough space on the image to show the
product callouts. The offerId
field that is part of the featuredProduct
object must match the offerId
value on the products
resource, which is different from the id
value
on the products
resource.
In addition to the imageLink
and featuredProduct
fields, which are required
for Shoppable Images, you can also specify a collection headline using the
optional headline
field. We recommend including a headline to provide
customers with additional details about the collection.
To create a new collection for Shoppable Images, make a POST
request to the collections.insert
endpoint using the following URL and request body:
https://shoppingcontent.googleapis.com/content/v2.1/ merchantId
/collections
{
" id
" :
" exampleCollec
t
io
n
"
" la
n
guage
" :
" e
n
" ,
" produc
t
Cou
ntr
y
" :
" UK
" ,
" imageLi
n
k
" :
[
" www.imageLi
n
k.example
" ],
" feature
dProduc
t
" :
[
{
" o
ffer
Id
" :
' 432
' ,
" x
" :
0.11
,
" y
" :
0.99
},
{
" o
ffer
Id
" :
' 433
' ,
" x
" :
0.53
,
" y
" :
0.89
}
],
" li
n
k
" :
" www.li
n
k.example
" ,
" mobileLi
n
k
" :
" www.mobileLi
n
k.example
" ,
" headli
ne
" :
" www.li
n
k.example
" ,
" cus
t
omLabel
0
" :
" Orga
n
ize
" ,
" cus
t
omLabel
1
" :
" Your
" ,
" cus
t
omLabel
2
" :
" Biddi
n
g/Repor
t
i
n
g
" ,
" cus
t
omLabel
3
" :
" Wi
t
h
" ,
" cus
t
omLabel
4
" :
" Me
" }
Example: Check the status of a collection
To discover whether the collection you created above has issues that would
invalidate the collection from serving ads, make a GET
request to the collectionsstatuses.get
endpoint using the following URL, and include the id
of the collection whose status you want to retrieve. You do not have to provide
a request body.
https://shoppingcontent.googleapis.com/content/v2.1/ merchantID
/collectionstatuses/ collection ID
Example collection status response
{
" id
" :
" exampleCollec
t
io
n
" ,
" crea
t
io
n
Da
te
" :
" 2020-09-22
T
00
:
26
:
51
Z
" ,
" las
t
Upda
te
Da
te
" :
" 2020-09-22
T
00
:
26
:
51
Z
" ,
" collec
t
io
n
LevelIssues
" :
[
{
" code
" :
" i
n
valid_url
" ,
" servabili
t
y
" :
" u
naffe
c
te
d
" ,
" resolu
t
io
n
" :
" mercha
nt
_ac
t
io
n
" ,
" a
ttr
ibu
te
Name
" :
" li
n
k
" ,
" descrip
t
io
n
" :
" I
n
valid
URL
[
li
n
k
]",
" de
ta
il
" :
" Use
a
comple
te
URL
t
ha
t
s
tarts
wi
t
h
h
tt
p
:
// or https:// and
li
n
ks
t
o
a
valid
des
t
i
nat
io
n
such
as
a
n
image
or
a
la
n
di
n
g
page
" ,
" docume
ntat
io
n
" :
" h
tt
ps
:
//support.google.com/merchants/answer/7052112
"
},
{
" code
" :
" i
n
valid_url
" ,
" servabili
t
y
" :
" u
naffe
c
te
d
" ,
" resolu
t
io
n
" :
" mercha
nt
_ac
t
io
n
" ,
" a
ttr
ibu
te
Name
" :
" imageLi
n
k
" ,
" descrip
t
io
n
" :
" I
n
valid
URL
[
imageLi
n
k
]",
" de
ta
il
" :
" Use
a
comple
te
URL
t
ha
t
s
tarts
wi
t
h
h
tt
p
:
// or https:// and
li
n
ks
t
o
a
valid
des
t
i
nat
io
n
such
as
a
n
image
or
a
la
n
di
n
g
page
" ,
" docume
ntat
io
n
" :
" h
tt
ps
:
//support.google.com/merchants/answer/7052112
"
}
]
}