Thursday, 28 October 2010 19:11

Connecting Magento eCommerce to Multi-Client Google Base / Merchant Center Account(s)

Written by 

Magento_IconMagento 1.4+ includes an easy-to-use feature for connecting to the Google Merchant Center (formerly 'Google Base') and uploading product data for placement in the BETA Google Product Search.  Unfortunately, that feature is based on a single Google login, which may be a problem if you have multiple domains and stores in your Merchant Center Account.  Here's the solution:

The Problem - One Login Only

Magento uses a single login to connect to the Google Merchant Center and upload product data.  However, many eCommerce managers and webmasters will have a multi-client account at Google Merchant Center and there's no obvious way in Magento to associate the data feed with one domain or store, and not another.

The Solution - Specify the Client ID

Use the login feature for Google Base in Magento, but modify a few of Magento's files to specify which store should receive the product feed.

First modify the fiile lib/Zend/Gdata.php script around line 200, so that the client ID is inserted into the URL:

$url = str_replace('feeds/items', 'feeds/1234567/items', $filterResult['url']);

That should be enough to connect to the Google Merchant Center and properly submit a feed.  However, we'll need to make an additional modification in order to ensure that the "Google Base --> Manage Attributes" page is still accessible in Magento.

Navigate to and modify app/code/core/Mage/GoogleBase/Model/Service/Feed.php (line 37):

const ITEM_TYPES_LOCATION = 'http://www.google.com/base/feeds/itemtypes'; const ITEMS_LOCATION = 'http://www.google.com/base/feeds/1234567/items';

This isn't a perfect solution, but it's a quick and easy way to connect Magento to multi-client accounts at Google Base/Merchant Center. Hope it's helpful for you!

This article is based on the forum post How Do I Setup Google Base?. Thanks are due in particular to forum user Jason J for the fix.

A Quote for your Consideration:

"What's missing most from business today?
Not sales. Not service. Not technology.
Answer: A point of view."

Source: Jason Fried, Founder of 37signals.