I’ve worked on a few Magento builds recently where the client has requested Google Merchant Centre integration. We’ve used some third party tools previously to create feed files that we can then pass on to Google Content. However, in a recent project, we were looking for a more integrated, close-knit solution, so we looked at Mage’s own Google Content extension.

The first thing you’ll notice is that this uses the API. To get access to the API, your account has to be approved by Google. You’ll need to fill in this form. Once Google has activated your account for API use, you’re good to go.

Next you’ll need to set a few things up – such as mapping a GTIN field etc, but most of the work is taken care of by the extension and you can quickly start syncronising content.

The client on this project specifically requested that their brandname appeared prefixed to the product title.

The problem is in the Title attribute- even though there the extension allows you to map Google’s ‘title’ with a custom attribute, Google automatically pulls product title info from ‘name’ attribute. The issue here is with Magento’s implementation.

For this implementation, another attribute was created and populated with the “brand-productname” convention, so that we could re-map it.

The only file you need to be interested in is: /app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php

The lines we’re interested in, are:

When happens here is, $name is null, so it tries to get a new mapping. It fails, and thus, you get the product name in the if statement below it.

Simply change this line to the below, and your titles will be sent to Google as you intended them!

Image Credit: rogiro