Google Base ID Results in Error in Magento

When I click on the Google Base ID (the number listed in orange next to your product name) I get an error page from Google that says:

Oops
We didn’t understand that.
You have tried to access a non-existent page.

I have seen where some people have created scripts to submit to Google Base and Shopping.com, but I would MUCH prefer that Magento interfaced with the items and I could use Magento to add, delete and monitor the items I submit to Google Base.

This is the fix that we found after some searching:

The URL that magento is using for Google Base products is outdated. The products are being submitted – the link is just incorrect.

Open app\code\core\Mage\GoogleBase\Block\Adminhtml\Items\Renderer\Id.php

and change the line that reads:

$baseUrl =’http://www.google.com/base/step2offer?docId=’;

to

$baseUrl =’http://www.google.com/merchants/view?docId=’;

That should cure the Google Base eror message of your product not being found.

Google Base Product Types

If you want to get your products listed with Google Base or Google Merchant Center, you’re going to have to know your Google Base Product Type. Problem for us is that Google is VERY limited when they offer product types and a lot of them make no sense, but oh well, Google seems to be king!

Here is the link to Google Base Product Types.

Like I said, a lot of times the product types don’t make sense, but I don’t think it matters as long as you do it Google’s way. For instance, we sell quite a few Backup Cameras For Trucks. We’ve always listed them as a Google Product Type of “Vehicles & Parts”, but the best we can tell, we’re never listed under Shopping results with Google. We’re now thinking about trying “Vehicles & Parts > Automotive Audio & Video > Car Video Devices”, but not sure if that will work. Someone has suggested they should be here: “Vehicles & Parts > Automotive Audio & Video”. Or should it just go here: “Vehicles & Parts > Automotive Interior > Dashboard Accessories”? We’ve even had suggestions of specifying them as “Vehicles & Parts > Automotive Interior > Dashboard Accessories”.

I guess we’re going to try different ones and see which ones get results.

Problems With Google Base and Magento

If any of you are having problems with data feeds from Magento to add products to Google Base or what is now referred to as Google Merchant Center, here are a few things we have come accross:

When you are setting up Google Base Attributes, a few things should be known.

In case you’re interested, according to Google, you have to have the following attributes:

  • id
  • title
  • link
  • price
  • description
  • condition

Then, according to Google, they suggest the following attributes for Google Base items:

  • gtin
  • brand
  • mpn
  • image link
  • product type
  • quantity
  • availability
  • shipping
  • tax
  • feature
  • online only
  • manufacturer
  • expiration date
  • shipping weight
  • product review average
  • product review count
  • genre
  • featured product
  • excluded destination
  • color
  • size
  • year
  • author
  • edition

We found the above information on google.com here.

We haven’t tested this out completely in Magento, but can say this.¬†We played around with attributes and when trying to add a product to Google Base, we got this error: Expected response code 200, got 400. Type: data. Field: title. Reason: Duplicate title. Type: data. Field: link. Reason: Duplicate url

Turns out Magento by default apparently adds those attributes automatically to the feed. So if you have Google Base Attribute “title” specified, get rid of that. Next if you have Google Base Attribute “link” specified, get rid of that too. If you specified image location attribute, get rid of that too, Magento does that for you.

That should fix the error message. We’re now playing around with the Google Base Attributes and deleted all of our products (over 4318 of them) from Google Merchant Center and have begun to publish them with our new attributes sets which include shipping,manufacturer,product type, id, model number, description, brand, price, condition and gtin.

We’ll probably play more with others, but right now we’re anxious to see the results from this test.

How To Get A Random Image On Your Page Using CSS or PHP

We have some websites where we would like to have a different, random header image on various pages and maybe even various random images in different areas of the website.

We found this bit of code that worked great, although it doesn’t use CSS, but a simple bit of PHP code. Here it is:

<img src=”http://www.yoursite.com/directory-for-your-header-images/header_<?php echo(rand(1,5)); ?>.jpg”

width=”1024″ height=”300″ alt=”automotive tools and power tools” />

Of course, you’re going to enter all your own data and variables, but surely you get the picture.

It’s that simple, place that code wherever you want your random image and there you go.