Skip to content

Sample Google Shopping Feed#


Description#

The following code uses Miva built in Feed Management Tools to create a google shopping feed. This example is intended an an example which you can use as a starting point and customize for you needs. The column headers may need to be changed for your specific products. Also this leaves out tax and shipping from the feed, as those can be setup globally in Google Merchant Center.

This feed includes an expiration date set for 30 days in the future as well as full code to include full paths to the images.

<mvt:assign name="g.days_in_future" value="30" />

<mvt:assign name="g.days_in_seconds" value="(60*60*24) * g.days_in_future" />

<mvt:assign name = "l.settings:month" value = "padl( time_t_month( s.time_t + g.days_in_seconds, 'local' ), 2, '0' )" />
<mvt:assign name = "l.settings:day"   value = "padl( time_t_dayofmonth( s.time_t + g.days_in_seconds, 'local' ), 2, '0' )" />
<mvt:assign name = "l.settings:year"  value = "time_t_year( s.time_t + g.days_in_seconds, 'local' )" />

<mvt:assign name="g.future_date" value="l.settings:year $ '-' $ l.settings:month $ '-' $ l.settings:day" />

PRODUCT ID,PRODUCT TITLE,DESCRIPTION,GOOGLE PRODUCT CATEGORY,PRODUCT TYPE,LINK,MOBILE LINK,IMAGE LINK,CONDITION,AVAILABILITY,PRICE,COLOR,MATERIAL,WEIGHT,GENDER,AGE GROUP,BRAND,EXPIRATION_DATE,&mvt:eol:crlf;
<mvt:if expr="NOT ISNULL l.settings:record:customfield:main">
    <mvt:assign name="g.full_image_path" value="g.domain:base_url $ l.settings:record:customfield:main" />
<mvt:else>
    <mvt:assign name="g.full_image_path" value="''" />
</mvt:if>

&mvt:record:code;,&mvt:record:name;,&mvt:record:descrip;,&mvt:record:customfield:googleshopping_product_category;,&mvt:record:customfield:googleshopping_product_type;,&mvt:record:url;,&mvt:record:url;,&mvt:global:full_image_path;,&mvt:record:customfield:googleshopping_condition;,&mvt:record:customfield:googleshopping_availability;,&mvt:record:price;,&mvt:record:customfield:googleshopping_color;,&mvt:record:customfield:googleshopping_material;,&mvt:record:weight;,&mvt:record:customfield:googleshopping_gender;,&mvt:record:customfield:googleshopping_age_group;,&mvt:record:customfield:googleshopping_brand;,&mvt:global:future_date;,&mvt:eol:crlf;