google apps » Page 2

Tag: google apps

Google Sites to include Templates features

Google Sites, a member of the Google Apps family as well as a stand-alone feature, has added site template to the feature list of this great product. Now, instead of the relatively lame themes you now have complete site templates that include not only the overall theme of the site but also suggested content, structure and gadgets that take full advantage of the platform.

Now don’t get me wrong, the themes were nice for personal sites in a GeoCities/FrontPage kind of way but there is so much you can do with Templates. Admittedly, many of the initial templates that are available are still a little "blocky", there are a number that one would be hard pressed to tell weren’t custom sites if it weren’t for the

Read more

Creating Or Using a Google Account

Have you lately been asked to log into your Google account to access a calendar, site, Google Analytics, Google Adword, Google webmaster tools or other Google service but didn’t know how or what your Google Account was?

Well, this is simple if you have an email address that ends in @gmail.com as your email address is the key to your account. To utilize any of the other services available from Google including iGoogle, Web History, Google Checkout or Google Docs you would just sign in using your email address and the associated password.

However, it is more likely that confusion is caused when someone (a consultant or web geek or friend) sends you an email saying "I’ve set you up with access to Google Analytics for your site. Go ahead and use your Google Account with an email address of yourname@domainname.com" and you have no idea what they are talking about.

imageOne of the quickest and easiest ways to do this is to go to https://www.google.com/accounts/Login and clicking on "Create an account now" link at lower right.

Read more

Backup Your Google Apps Data

One of the concerns we hear from people is "How do we backup our data when it lives in the cloud?" Well, if you are using Google Apps, or even just plain old Google Docs, the option is there to do this.

The first thing you’ll need to do is to select all of your documents. Because Google uses an "infiinite scrolling" technique to display your documents, you may need to select "All Items" in the left menu and then scroll all the way to the bottom of your list of items; ensuring that Google has loaded all the documents on the screen. Then you can pull down checkbox selector and choose "Select all visible". This will put a checkbox next to each item on the list.

Select All Items screenshot

Next you’ll either right click on the listed items and select "Export" or pull down the "More Actions" menu item and select "Export".

Read more

Moving From One Google Apps Account To Another

I’ve had a number of customers who’ve moved from one Google Apps account to another recently and thought I’d write down the steps on how to do this for use by others in the same situation. This seems to happen regularly with startups who change their business model (along with their domain name) mid-stream.

Some people just might add the new domain name to their existing Google Apps account but this means they can’t send AS the new domain unless they set up “Send Mail As” and set the new account as their default, but more importantly, the other elements of their Google Apps suite (like docs, calendar, etc) will be in the old domain.

imageSo, once you have accounts in both domains you will go into your OLD account and set up forwarding. This is done by  going into the “Settings” section of your imagewebsite  and  selecting the “Forwarding and POP/IMAP” tab.

Read more

Using Google Spreadsheets to Collect Form Data

Google Spreadsheets recently offered the ability to create a form that will collect customer information into the spreadsheet. This is great for people that don’t have access to storing data in a traditional database (which is our preferred solution). They offer you the code to either link to for this form, email the code (great for emailed surveys) as well as code to embed (via IFrame) the form in your existing web page.

If you’d prefer to have FULL control over the display of the form and control the formatting and manipulation of data with your server-side code here is a handy little guide on how to do this using PHP.

 

  1. Create Google Doc form with all the fields your form needs
    image
  2. Save the form
    image
  3. Email yourself a copy of the form
    image
  4. Pull the necessary fields out of the email to generate the form
    URL for curl to post to
    URL to post form to...
    Names of the various input fields
    Finding the name of the various fields
  5. Insert code below into PHP page
  6. Test solution
   1: //In order to post to Google Spreadsheet Form

   2: //http://spreadsheets.google.com/formResponse?formkey=dFdYSTlzUVJsSomeReallyLongKeyGoesHereqemU2YUE6MA..

   3: //Name "entry.0.single" 

   4: //Email is "entry.1.single"

   5: //Phone is "entry.2.single"

   6: //Comment is "entry.3.single"

   7: //IP address is "entry.4.single"

   8: $url = 'http://spreadsheets.google.com/formResponse?formkey=dFdYSTlzUVJsSomeReallyLongKeyGoesHereqemU2YUE6MA..';

   9: // Create post array to send results to Google Spreadsheets

  10: $fields = array(

  11:                         'entry.0.single'=>urlencode($name),

  12:                         'entry.1.single'=>urlencode($email),

  13:                         'entry.2.single'=>urlencode($phone),

  14:                         'entry.3.single'=>urlencode($comments),

  15:                         'entry.4.single'=>getRealIpAddr(),

  16:                         'submit'=>'submit'

  17:                 );

  18:  

  19: // Begining of code for posting to Google Spreadsheet

  20: $fields_string = '';

  21: //url-ify the data for the POST

  22: foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }

  23: //rtrim($fields_string,"& ");

  24: $fields_string = substr($fields_string, 0, strlen($fields_string)-1); 

  25: $result = "Fields_String: [" . $fields_string . "]<br />";

  26:  

  27: //set POST variables for Google Spreadsheets

  28: //open connection

  29: $ch = curl_init();

  30:  

  31: //set the url, number of POST vars, POST data

  32: curl_setopt($ch,CURLOPT_URL,$url);

  33: curl_setopt($ch,CURLOPT_POST,count($fields));

  34: curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

  35: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  36: curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');

  37:  

  38: //execute post

  39: $result .= "Curl Results: [" . curl_exec($ch) . "]<br />";

  40:  

  41: //close connection

  42: curl_close($ch);

Things to note about the above PHP code (gasp!) are that you need to define the proper URL to the spreadsheet and the correct number and names of  fields (see step 4 above) . The only one that might be a little odd is getRealIpAddr() method. This is defined elsewhere in the page’s code as follows:

   1: // Function to get real IP address in case visitor is behind a proxy server

   2: function getRealIpAddr()

   3: {

   4:     if (!empty($_SERVER['HTTP_CLIENT_IP'])) // Check IP from shared internet

   5:     {

   6:         $ip = $_SERVER['HTTP_CLIENT_IP'];

   7:     }

   8:     elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) // to check if ip is passed from proxy

   9:     {

  10:         $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

  11:     }

  12:     else

  13:     {

  14:         $ip = $_SERVER['REMOTE_ADDR'];

  15:     }

  16:     return $ip;

  17: }

 

 

 

Have fun folks! If you want to rip into my code and/or have suggestions on better PHP coding styles, please use the comment section below…

Using a Google Spreadsheet as a Database

I recently had the opportunity to attempt to create a simple little CMS for a single page on a website hosted on a Linux box somewhere out there in the cloud. We wanted to offer the client (who had no experience or patience to work in HTML) the ability to update the content on this page. So, with Google’s search engine as my reference material (who needs to buy programming books any more?) I launched into writing some PHP code that will read a published Google Spreadsheet and treat each of the sheets as a table.

Kinda nifty stuff!

Of course, if we are going to do this, I’d prefer the customer use their own spreadsheet so we aren’t held responsible for failure to ensure the existence of this spreadsheet and it’s content. So, here are the steps required to properly publish a Google Spreadsheet that can be consumed by another website:

Create your Google Spreadsheet – In this case, we’ve got 5 columns that contain information to be used in an unordered list typical of a Resources (links) page.

 Publish your Google Spreadsheet – This is the “hardest step” we’d be asking of our client. It entails pulling down the Share button at top right of spreadsheet and selecting Publish as a web page.

image

imageConfigure Published Data Link -  In our scenario, we are publishing All Sheets, Automatically republishing this data when changes are made and we are NOT requiring a login to view this data (making it publicly visible). Once you’ve pressed the  “Start Publishing” button, the bottom half of the form will become active, allowing you to create the correct link to the data in a format that can be programmatically consumed by our target web page. In this case, we want to select CSV data and we are only interested in the “Resource Links” sheet in this spreadsheet. We are taking all available cells. Copy and paste the provided URL and you are good to consume this data via the programming language of your choice.

 

“But  Mike”, you say… “Why not just publish it as HTML to embed in a page” using the aptly named option on this dialog box? Good question. In this case, we want this data to be tied back directly to our client’s site rather than having the content iframed in from spreadsheets.google.com. Better to have this quality content showing up on the clients site for SERP and Page Rank purposes.

“But Mike”, you stammer again… “Why not use the GData APIs that have been written for PHP?” Another good question. In this case, I don’t know if the customer’s hosting environment has the API installed (it installs as an add-on to PHP) nor do I know if the host company will do this for our client even if we begged them to. So this provides us with a nice, lightweight way to address this in any hosting environment that supports later versions of PHP (anything greater than 4.02).

And that’s all there is to it. Perhaps if you are good, and ask really nicely, I’ll make the time to post the source code to consume this data.

Running Ecommerce Store from Google Spreadsheet

Google has recently released announced a Google Store Gadget that relies on Google Spreadsheets as the database in an attempt to make it easier for people to set up electronic shop on the world wide web with little effort and no cost (assuming you have SOME sort of presence on the ‘Net).  While this is definitely cheaper and somewhat easier to implement than most ecommerce solutions, it is not as easy as some anticipated it would (or could) be.

However, it is a great example of something they’ve been telling programmers for some time: use Google Spreadsheets as datasources. This example uses an engine (spreadsheets) that most computer users are familiar with to replace complicated databases for a rather simple solution.

After playing with it a bit I figured why not create a 3 step guide (more or less) to set this up.

 

  1. Create Google Checkout account for client (http://checkout.google.com/sell/)
    1. Save the Merchant ID for later use:
      image
  2. Create a spreadsheet in Google Docs (preferably in customer’s account). You can copy the sample template Google provides.
    1. Using "Share" pulldown on the top right corner of the spreadsheet header, you need to "Publish To The Web"
      image
    2. In the pop-up box check "Automatically republish when changes are made" and then click "Start Publishing"
      image
  3. Create and embed the required code into your website
    1. Into any website that accepts raw HTML
      1. Select the store configuration tool below for the desired size:
        1. Store Configuration Tool – LARGE
        2. Store Configuration Tool – SMALL
        3. Store Configuration Tool – TINY
      2. In the store configuration tool, enter the entire URL of your inventory spreadsheet (including the "?key=" portion) intot he "Data Source URL" field
      3. Enter the customer’s Merchant ID (from Step 1)
      4. In the store configuration tool, click "Preview Changes" to see a preview.
      5. Make any desired customizations
      6. When you like what you see, click "Get the Code" button
      7. Copy the code snippet
      8. Paste the code snippet for your gadget into your page
    2. Into Google Sites
      1. Sign in to Google Sites
      2. Choose the page you’d like to add your gadget to
      3. Click the "Edit Page" button
      4. To add your gadget:
        1. Chose "More gadgets…" from the "Insert" drop-down menu
        2. At the "Add a gadget to your page" prompt, select "Add gadget by URL" in the bottom left-hand side of the screen
        3. Enter the URL for the desired gadget:
          1. Large Store – http://checkout.google.com/seller/gsg/beta2/large-store.xml
          2. Small Gadget – http://checkout.google.com/seller/gsg/beta2/small-store.xml
          3. Tiny Gadget – http://checkout.google.com/seller/gsg/beta2/tiny-store.xml
        4. In the store configuration tool, enter the entire URL of your inventory spreadsheet (including the "?key=" portion) into the "Data Source URL" field
        5. Enter the customer’s Merchant ID (from Step 1)
        6. Click "Save" and you are done.
    3. Blogger, in a blog post
      1. Select the store configuration tool below for the desired size:
        1. Store Configuration Tool – LARGE
        2. Store Configuration Tool – SMALL
        3. Store Configuration Tool – TINY
      2. In the store configuration tool, enter the entire URL of your inventory spreadsheet (including the "?key=" portion) intot he "Data Source URL" field
      3. Enter the customer’s Merchant ID (from Step 1)
      4. In the store configuration tool, click "Preview Changes" to see a preview.
      5. Make any desired customizations
      6. When you like what you see, click "Get the Code" button
      7. Copy the code snippet
      8. From Blogger, create a new blog entry or edit an existing entry
      9. Click on "Edit HTML" and paste the code snippet for your gadget.
    4. Blogger, in a side bar
      1. Visit Blogger
      2. Select the "Edit Layout" section for your blog
      3. Click on "Add a Gadget"
      4. In the prompt, choose "Add your own" (at the bottom)
      5. Enter the URL for your desired gadget and click "Add by URL"
        1. Large Store – http://checkout.google.com/seller/gsg/beta2/large-store.xml
        2. Small Gadget – http://checkout.google.com/seller/gsg/beta2/small-store.xml
        3. Tiny Gadget – http://checkout.google.com/seller/gsg/beta2/tiny-store.xml
      6. In the store configuration tool, enter the entire URL of your inventory spreadsheet (including the "?key=" portion) into the "Data Source URL" field
      7. Enter the customer’s Merchant ID (from Step 1)
      8. Click "Save" and you are done.
      9. TIP: After adding the gadget, you can move your gadget around to different parts of your blog using the "Layout" section in your Blogger Account.
    5. iGoogle
      1. Go to iGoogle and click on "Add Stuff…" and in left column, click on "Add feed or gadget"
      2. Enter one of the following URLs and click "Add"
        1. Large Store – http://checkout.google.com/seller/gsg/beta2/large-store.xml
        2. Small Gadget – http://checkout.google.com/seller/gsg/beta2/small-store.xml
        3. Tiny Gadget – http://checkout.google.com/seller/gsg/beta2/tiny-store.xml
      3. Go back to your iGoogle page
      4. On your gadget, click the settings drop down and choose "Edit Settings"
      5. In the store configuration tool, enter the entire URL of your inventory spreadsheet (including the "?key=" portion) into the "Data Source URL" field
      6. Enter the customer’s Merchant ID (from Step 1)
      7. Click "Save" and you are done.

    That’s all there is to it! It took me 5 minutes to set up the following store: http://exhibita.com/shopping-cart.aspx. It took me a lot longer to write this up than to actually do it! If your needs are simple but you’d like to categorize your solutions better, you can create multiple pages that link to multiple spreadsheets (or potentially pages within a single spreadsheet) and just place the appropriate code on each page. The nice thing is that products placed into a cart on one page will follow you around to all the other pages just like in a real shopping cart.

    Of course this isn’t a proper replacement for a full-fledged ecommerce solution like AspDotNetStorefront but it certiainly will help a lot of people to integrate fairly single shopping carts into their blogs and websites.

    Running into problems? Try the Google Checkout store gadget forum

    We’d love to hear from you if you’ve implemented a Google Checkout Gadget; use the comments below to contribute to the ongoing conversation.