SaaS CMS has officially launched! Learn more now.

Dan Matthews
Jul 27, 2017
  2216
(1 votes)

Vulcan + Epi Commerce + Google Merchant = Happy

I recently had to get to grips with the Google Product Feed on an Episerver Commerce site. This potentially requires some fairly heavy lifting. This is probably why the awesome dudes over at Geta made a nice product feed tool that uses the Dynamic Data Store as a sort of cache. It’s probably a great tool, but I couldn’t get it working and it didn’t do quite what I wanted. I could have persisted, but I actually had a great opportunity in that the site I was working on was already using Vulcan, the lightweight ElasticSearch client for Episerver. With Vulcan, we can make the most of the high-performance search to do much of the heavy lifting, like the price handling. Because this code could be useful to others, I decided to make my product feed / Vulcan implementation generic, open source and on the Episerver Nuget feed. To install it, simply find it on nuget as TcbInternetSolutions.Vulcan.Commerce.GoogleProductFeed.

Once installed, you can hit the default product feed straight away. Simply go to http://yoursite.com/GoogleProductFeed/Default. This is the default feed, which for some territories may be enough. However, you may well want to specify additional properties to be included. For example, you may want to set a GTIN on your Variants and have that included. To configure that, create an InitializationModule and create a feed in the Initialize method. For example:

            var feed = ServiceLocator.Current.GetInstance<IGoogleProductFeedService>().CreateFeed<SiteVariationBase>("MyFeed");

            feed.BrandSelector = p => p.Brand;
            feed.DescriptionSelector = p => p.ShortDescription;
            feed.GTINSelector = p => p.GTIN;

This will create a feed at http://yoursite.com/GoogleProductFeed/MyFeed and will use the specified properties from your Variant type in the appropriate fields. f you don’t have the properties, then add them to whatever your base class for Variants is. You can also specify the Query to be passed through to Vulcan if you want by setting the Query property on the feed – this could do things like filter out certain products, or maybe you could create multiple feeds for different product categories. The URL for the feed is also very powerful, and uses the following segments:

GoogleProductFeed/[YOUR FEED NAME]/{market}/{language}/{currency}

If you skip the additional parameters, it will use the default market, language and currency. If you specify them, use short names, such as:

GoogleProductFeed/MyFeed/SouthAfrica/en-za/zar

With this technique, you can register multiple product feeds in your Google Merchant Centre for your different territories. Note that some territories have mandatory requirements on shipping, brand etc. Make sure that your feeds are correctly configured!

DISCLAIMER: This project is in no way connected with or endorsed by Episerver. It is being created under the auspices of a South African company and is entirely separate to what I do as an Episerver employee.

Jul 27, 2017

Comments

Please login to comment.
Latest blogs
Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024

GetNextSegment with empty Remaining causing fuzzes

Optimizely CMS offers you to create partial routers. This concept allows you display content differently depending on the routed content in the URL...

David Drouin-Prince | Jul 8, 2024 | Syndicated blog

Product Listing Page - using Graph

Optimizely Graph makes it possible to query your data in an advanced way, by using GraphQL. Querying data, using facets and search phrases, is very...

Jonas Bergqvist | Jul 5, 2024