My favorites | English | Sign in

Google Checkout

Checkout Shopping Cart

How to add a Checkout shopping cart to your site

The Checkout shopping cart lets your customers buy multiple items at a time from your website. A buyer can add one or more items to the shopping cart, and then complete the purchase through Google Checkout. After a buyer confirms the purchase, an order is displayed in the Google Checkout Merchant Center for you to process. You'll also receive an email from Google Checkout notifying you of the new order. To see how the shopping cart works, take a look at the demo store.

You implement the Checkout shopping cart using CSS classes within HTML tags, and a JavaScript script that is provided by Google. You can easily add the cart to your site and customize the cart's look and behavior.

Note: Hand Coding - You can either write your own HTML code for the shopping cart, as described in Hand coding for Checkout shopping cart or your can use the Cart Wizard as described in this document.

Purpose

This document describes how to add a Google shopping cart to your website using the Cart Wizard.

Assumptions

  • Your online store does not already have a shopping cart.
  • You will use the Merchant Center to charge orders and update order status.

Technical skills required

  • You need to be familiar with HTML, CSS, and must be able to update your site's webpages.

Prerequisites

  • Buyer Experience See how an order is completed at Google Checkout Buyer Experience
  • Order Flow It's helpful to read Typical order flow to see the sequence of events: a buyer places an order, merchant accepts, charges and ships the order.

This symbol Open link in new window means that the link opens up the page in a new window or tab. When you're done with that step, you can close the window or tab and go to the next step.

Step 1. Sign up for a Google Checkout merchant account

  • Sign up now (http://checkout.google.com/sell/signup) for a Checkout merchant account if you don't already have one.

    This is a production (http://code.google.com/apis/checkout/developer/Google_Checkout_Glossary.html#production) account, for receiving orders from actual paying customers. You will need to supply an email address. We'll send an email to that address and ask you to confirm your account request. You will also need to supply information that personally identifies you or your business. Depending on the country, this might include a credit card number, tax number, registration number or other identification.

  • Specify a bank account

    Follow these instructions to get paid: Bank account set up and verification (http://checkout.google.com/support/sell/bin/answer.py&hl=en&answer=113730).

    Google automatically initiates payouts to your bank account within two business days after you successfully charge an order. Before you can get paid, you need to specify and verify your bank account so that you'll be eligible for payouts. Please note that you can begin processing Checkout orders before your bank account has been verified.

  • Allow unsigned carts

    Go to the Integration Settings (https://checkout.google.com/sell/settings?section=Integration) page and uncheck the checkbox labeled My company will only post digitally signed carts. Then click the Save button.

    Note: A signed cart is a shopping cart that has a cryptographically secure digital signature, which enables Google to verify that your Checkout API request was not altered before Google received it. You must use the XML API (http://www.code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html) if you want to post signed shopping carts. These instructions instead use the HTML API. You therefore need to ensure that the prices and other information in those orders are correct before charging customers and fulfilling orders.

Step 2. Sign in to your Google Checkout merchant account

  • Sign inOpen link in new window (https://checkout.google.com/sell) to the merchant account that you created in the previous step.

Step 3. Ensure auto-charge is disabled

  • To allow yourself time to manually review all orders, you need to make sure customers are not automatically charged when they place an order. On the PreferencesOpen link in new window (https://checkout.google.com/sell/settings?section=Preferences) tab, make sure that the Automatically authorize the buyer's credit card for the full amount of the order option is selected, as follows:

    no charge

Step 4. Add the Cart and an "Add to cart" button

  • Go to the Cart WizardOpen link in new window (https://checkout.google.com/sell2/settings?section=CartWizard) page, then complete the page as follows:
    • Choose product type. Choose one of the following options:

      • simple - Choose this if your product requires only a title, a price, and optionally an image.
      • with multiple options - Choose this if your product has options, such as size, or color, that do not affect the product's price.
      • with multiple prices - Choose this if your product has options, such as size, or color, that affect the product's price.
    • Describe your product. Depending on your product type, complete this section as follows:

      • Specify a title, a price, and optionally an image for your product.
      • If your product has more than two options, click the add an option link.
    • Preview. Click the blue Add to cart button to see a preview of your shopping cart.

    • When you are happy with your choices, click Create button code. The wizard creates two pieces of code consisting of HTML tags, and CSS classes.

    • Depending on your choices, the first piece of code is similar to the following:

      First piece of code generated by the wizard

      This first piece of code specifies information for your product and an Add to cart button. Copy the code generated by the wizard, and use an HTML editor to open the HTML page on which you want the product to appear. Paste the code into the location in which you want the product to appear anywhere between the <body> and </body> tags.

    • Depending on your choices, the second piece of code is similar to the following:

      Second piece of code generated by the wizard

      This second piece of code specifies the shopping cart. The wizard automatically inserts your Merchant ID and currency for your location. Copy the code generated by the wizard, and paste the code into the same HTML file, immediately before the </body> tag.

      Note: You must include the second piece of code once, and once only, in each HTML file that includes one or more products you want to sell using the Google shopping cart. By default, the cart appears in the top right hand corner of your browser. To place the cart in a different location, or to change the cart's appearance or behavior, see Controlling the shopping cart widgetOpen link in new window (http://www.code.google.com/apis/checkout/developer/Google_Checkout_Shopping_Cart_Understanding_Shopping_Cart_Widget.html).

    • Save the HTML file to your local disk, then open it in a browser. Click the Add to cart button to try out your shopping cart.

    • To create code for another product, click the Generate code for another product button. Copy and paste the code generated as described above. Repeat for each of the products in your online store.

Step 5. Set up tax settings

  • Set up tax on the Tax set upOpen link in new window (https://checkout.google.com/sell/settings?section=TaxSetup) page. The Checkout shopping cart adds the tax you specify to each order.

    • If you are in the United Kingdom, you can specify VAT rates for each of the European Union countries.
    • If you are in the United States, you can specify tax rates for each state.

Note: If you specify a tax rate, and later want to change it, click the edit or delete links on the right hand side. You can't specify a tax rate of zero. Instead click the delete link to remove the tax rate.

  • In a browser, open one of the HTML files you previously saved. Click the Add to cart button to try out your tax settings.

Step 6. Set up shipping settings

  • You can specify shipping methods in the Merchant Center if you are shipping to buyers only within your home country.  You can specify flat shipping rates, custom rates, or both.  If this is satisfactory, specify one or more shipping rates as follows:
    • Go to the Shipping set upOpen link in new window (https://checkout.google.com/sell2/settings?section=SellerEditableShipping) page in the Merchant Center.
    • Click Create new method to add a shipping method, or click a shipping method name to edit an existing method.
    • Follow the steps on the page to specify the required information for your shipping method.
    • Click Save.
    • Repeat these steps for each shipping method you'd like to offer.

    Note: The name of each shipping method you specify is displayed when a buyer completes the checkout process, unless you have included alternate shipping methods in your cart post. The names you give each shipping method must be unique.

  • In the previous case, buyers from other countries will not be able to complete their purchase. If this is not sufficient for your needs, or if you want to apply other shipping options, see Annotating pages with shipping informationOpen link in new window (http://www.code.google.com/apis/checkout/developer/Google_Checkout_Shopping_Cart_Annotating_Shipping_Information.html).

Step 7. Add Analytics (Optional)

  • To add Google Analytics (http://www.google.com/analytics) tracking to your Checkout shopping cart integration, add the aid parameter to the <script> tag that specifies the Google shopping cart. Set the aid parameter value to the Analytics tracking code for your site. A Google Analytics tracking code has the format UA-#######-# and is associated with a particular Google Analytics profile.

    Key point: If you use the aid parameter in your shopping cart integration, you need to remove any Google Analytics code that appears on the same page as the cart.

    The HTML snippet below shows how a Google Analytics tracking code would appear in the HTML code for your web page. Note that you need to change the sample tracking code (UA-8883888-8) to your own tracking code, and also make sure your own merchant ID is specified.

    <script id="googlecart-script"
      type="text/javascript"
      src="http://checkout.google.com/seller/gsc/v2/cart.js?mid=MERCHANT_ID"
      aid="UA-8883888-8"
      currency="GBP">
    </script> 

    To track orders, you must enable e-commerce reporting in your Google Analytics account. The following steps explain how you enable e-commerce reporting for your website:

    • Log in to your Google Analytics account (http://www.google.com/analytics/).

    • Click the Edit link on the right hand side of the profile you want to enable.

    • On the Profile Settings page, click the Edit link at the top right hand corner of the Main Website Profile Information box.

    • Change the selected E-Commerce Website radio button from No to Yes.

Step 8. Customize the cart (Optional)

  • To set up further product options, shipping options, tax settings, and to change the cart's location, appearance and behavior, see Customizing your Checkout shopping cartOpen link in new window (http://www.code.google.com/apis/checkout/developer/Google_Checkout_Shopping_Cart_Customizing_Wizard.html).

Step 9. Go over the checklist

  • To ensure a positive, consistent experience for your customers, go over the Launch ChecklistOpen link in new window (http://www.code.google.com/apis/checkout/developer/Google_Checkout_Shopping_Cart_Launch_Checklist.html).

Step 10. Push Checkout live

  • Copy all the HTML files you have been working on locally to your website.

Step 11. Start processing orders

  • You can now start accepting orders, charging them, and marking them as shipped in the Google Checkout Merchant Center (http://www.code.google.com/apis/checkout/developer/Google_Checkout_Merchant_Center.html).

Orders placed using this procedure don't allow for digital signature authentication. As always, please review your orders before processing them.

Getting paid

After you've shipped a buyer's order and charged his or her credit or debit card, Google pays you the amount of the charge, minus a transaction fee. To find out about payment prerequisites and schedules, see: