Here’s a quick guide on how to set up a Google Base Product feed for your Shopify store. For more info, visit the Shopify Forums.
1. In the Shopify admin, go to Assets > Theme Editor. Under the Templates heading, click “Add a new template.”
2. A form will appear that says “Make an alternate version of Blog called alternate.” Change ‘blog’ to ‘page’ and ‘alternate’ to ‘googlefeed’ and click Create template.
![]()
3. You will now see an item called “page.googlefeed” listed under Templates. Click on it to edit it, and paste in Fortune Cookie Soap’s code for Google base, replacing all of the existing content for the template. Note that you will want to change the expiration date to 30 days from the present date. (Anything more and Base will give you a feed warning due to Google’s limits on expiration dates.)
![]()
4. Save page.googlefeed and close the code window. Click on the Blogs & Pages tab and click ‘Create a new page.’ For the title, type Google Base Product Feed and leave the ‘write your page’ section blank. Click Create page.
5. Once it has saved, click the Edit link, and on the right side under Template, change ‘page’ to ‘page.googlefeed’ and then click Update page.
6. Go back to Assets > Theme Editor, and under Snippets click ‘Add a new snippet’. In the box that appears, type in ‘shopdesc’ (after Make a snippet called…) and click Create snippet.
![]()
7. Now that the shopdesc snippet has been created, click on its icon under Snippets to edit. Type in a line or two describing your store, as this is the store description for your feed, and click Save.
![]()
8. You also need to make sure that you have a Collection called ‘All Products’ so that your Base feed will have all of your products in the one feed. To make a collection with all of your products, go to the Collections tab and click ‘Create Smart Collection.’ Type ‘All Products’ for the title and under Set your conditions, select ‘Product price’ ‘is greater than’ and type in .10 (for ten cents). If you have another criteria which works better for you, by all means use that. Click Create collection, and the page will refresh with a listing of all of your products A-Z.
9. Now in another browser tab, you should be able to view yoursite.com/pages/google-base-product-feed . Note that Firefox will automatically try and subscribe this page (since it is an RSS feed) to your default blog reader, so I recommend Safari, which will display the feed right in the browser window.
**Note** I removed {% if product.type != ‘Sample’ %} and {% endif %}from the page.googlefeed code because I did not need to differentiate the sample. I also removed the line <g:payment_notes>We also except Paypal and Google Checkout</g:payment_notes> because I do not accept Paypal or Google Checkout either.
Finally, once you have confirmed your feed is working, you can go to http://base.google.com (whiled logged into a Google/Gmail account you want to associate with this feed), click Sign in to Google base, accept the terms of service, and fill out the Account settings, like store name, description, site URL, business address, and contact info.
Once those fields have been completed, you will want to add a New Data Feed. Select your target country, your item type will be ‘Products’ and for the ‘Specify the data feed filename’ put google-base-product-feed without any file extension. Click Register data feed.
On the following page, under ‘Upload schedule’ click Create. Schedule the feed to update daily or weekly, depending on how often you add new or change your existing products. For ‘Url of file’ put the full address of your feed, e.g. http://www.yoursite.com/pages/google-base-product-feed and click Schedule. You will receive an email update when the feed is submitted, with any errors or warnings once it has been completed.
![]()
Your odyssey into the world of product feeds should now be over for now! Enjoy your Google Base. Many props to Fortune Cookie Soaps for the code and innovative work!
Thanks for posting this! I might suggest a few changes to the liquid code though…
1) Remove the truncate 50 from the description, Google accepts up to 10,000 chars.
2) Strip invalid characters from the description, like bullets, open and closing quotes, etc:
{{product.description | strip_html | strip_newlines | replace: ‘?’, ‘*’ | replace: ‘•’, ‘*’ | replace: “&”, “&” | replace: “©”, “©” | replace: “£”, “£” | replace: “"”, “‘” | replace: “””, “‘” | replace: “””, “‘” | replace: “™”, “” | replace: “é”, ‘e’ | replace: “®”, “” | replace: “±”, “+-” | replace: “’”,”‘” }}
Good points Michael, and thanks for the updated code! Without stripping those characters Google Base will throw warnings as I’ve already found.
Ack! The blog reformatted all my escapes into invalid characters. I’ve posted a plaintext version of the liquid code here:http://www.pixallent.com/google-base.txt
Yikes sorry didn’t notice that! Also, thanks for doing BaseSync for so long, it was an awesome app.
Thanks Paolo!
Also…another tip regarding the pagination…make sure the number (200) in the example is *more* than your total items, because the way liquid works we’ll only be pulling the first page of items, so anything above 200 in this case won’t be synced.
Oh, and it looks like the CDATA bit is important too, we didn’t use it in Basesync but it sure seems to help.
AND…
If you’re in the UK, you have to include VAT one way or another, by either putting “(including VAT)” or “(excluding VAT)” in the price field and making the appropriate tax setup in your Base Settings.
This makes my day! Thank you Paolo and Michael for taking the time to put together this tutorial.
Question, I was using Michael’s plaintext version of the google-base code but noticed a few characters in the CDATA section that seem to come through as garbage (what’s the technical term of that stuff by the way?) I didn’t know if that was intentional or not. In Paolo’s tutorial, the characters look normal.
I’m writing this as I’m working through it so I may come back and add another comment.
Thanks again guys!
… the price field meaning in Shopify, not in the feed.
Thx mike for the info I didn’t know that about the special chars or VAT, great info! I’ve updated the code at this post with all of the suggestions found here!
http://forums.shopify.com/categories/2/posts/29008
where exactly do i need to put “(including VAT)” or “(excluding VAT)” ? thanks
Stephen, I’m not the expert on this, but I believe the VAT is referring to putting it in with the “g:price” field, and then setting it in Base.
Thanks much for this! I had to tweak things a bit from later posts in the forum, but this really helped.
Hi All,
I have implemented this for 2 client sites with success however for some reason i cant get this feed http://www.discountsportonline.co.uk/pages/google-base-product-feed to work at all google base keeps replying no items inserted any suggestions would be most helpful
Cheers
Mike
The feed looks like it’s working Mike, I see 1000 products in it. Does Google Base return any errors in the daily report?
google base doesnt return any errors except “no items inserted”
i have also tried a new google base account and that doesnt seem to make any difference