How to build Google Shopping feeds with publications
Master the art of generating high-performing Google Shopping feeds directly from Struct PIM Publications.
Streamline your workflow and guarantee top-notch data quality with Struct PIM Publications, ensuring your product files always adhere to Google’s rigid feed requirements.
In this guide you will learn how to set up a publication template that fits the requirements for uploading product data to Google Merchant Center with Razor.
Getting started
To get started, we first need to create the publication template that will outline the structure for our data that we want to submit to Google Merchant Center.
First, navigate to the 'Publication'-page, and navigate to 'Publication template'.

Building the template
To create a new template, click the 'Create publication template' in the top right corner. This will take you to the template creation page.
The most important thing for this template is that we set the 'Type' to 'Data'. The reason for this is that we want to export the data in a specific format, and the 'Data' type allows this.
Give it a relevant name, and if you want to, an external ref.

Click 'Create'.
The page will expand, and you will be met with further settings. To learn more about what they are individually, you can read more about them in our references.
For this guide, we will select a rendering engine, file format and value properties.
Add 'RenderedValue' to value properties.
Set the rendering engine to 'Razor'.
Set the file format to XML since Google Merchant Center accepts XML.

Click 'Update'.
The template settings are now saved. The next step is designing the actual structure of the data. To do so, find the newly created template in the list, hover over it and click the -icon to open the designer.
Designing the template
Now we will go ahead and design the template so that it complies with Google Merchant Center requirements. You can read more about what specific requiremenets are relevant on this Google Merchant Center support article.
The most essential required tags are id, title, description, link, image_link, brand, gtin, availability, price and condition. However, additional tags will be required depending on what you are trying to publish. The requirements for products differ from the requirements for categories for example.
Google is very strict regarding what you can type into the different tags. You can learn more about the field specific values here.
Now that we have the template, we can go ahead and build an automated structure that fills out the different tags with the relevant product information. The following Razor-code should be placed inside the "HTML"-tab in the 'Content'-window.
Next, we need to add the base template so that Google Merchant Center can recognize the format.
Go to the 'Base template'-window and paste the following code:
The reason behind this is that by default, the designer encapsulates your XML with a <products> tag and Google Merchant Center requires that the first tag of the file is a <rss> tag.
Create the print publication
The next step we need to do is print the publication and make sure everything works as expected. To do so, head over to 'Print publications' in the menu on the left hand side of the screen.
Here, we can create a new print publication, which will use the template we have just created.

If you are unfamiliar with print publications, you can read more about them in our references.
Give it a relevant name, select the product category you want to print and set the data template to the template we created above.

The only thing left is printing the publication.
Click 'Create', and hover over the print publication in the grid. Click the 'Produce print publication'-icon.
Click 'Confirm'.

The publication will be downloaded as an XML file to your computer.
You are now all set and ready. The last thing to do is upload it to Google Merchant Center. Read more about how to upload files here.
Download the template
You can download and experiment with the template shown in this guide below.
Last updated