How-To: Adding JavaScript to GooglePages
July 15, 2006
Google Page Creator no longer removes JavaScript from GooglePages. Useful tools and active content, such as, Google Analytics, StatCounter, AdSense, Flash animation, and various JS widgets can now be added to any GooglePage (including the default home page) without resorting to hacks or manually uploaded HTML.
The detailed description of this new feature is too long to be posted here, so it is presented on GooglePage eXplorer website, including tutorials with specific instructions for adding JavaScript code for:
The following how-to briefly describes the suggested procedure for adding JS content to GooglePages. This procedure is generally safe for creating or editing any GooglePage, but it is strongly recommended to read the associated warnings and caveats before editing any functionally-important GooglePages, especially the default “home” page.
- use Firefox to avoid the GPC browser bugs in IE
- prepare the HTML code for each of the GooglePage fields in an external editor (Notepad will do, but something more powerful, e.g., PSPad, will be more convenient for editing many HTML files)
- create a new empty GooglePage in Google Page Creator
- use HTML Editor window to paste the prepared HTML code into each field
- do not use the WYSIWYG interface to edit any fields with JS code or custom formatting options
- note that most of the active JS content (e.g., AdSense) will not be actually displayed in the WYSIWYG window, which is normal, in fact, desirable behavior (see GPC JS execution bug description for details)
- “Publish” the GooglePage, but do not go “Back to Page Manager”
- use the “View Live” link (not “Preview”) to look at the published page
- make any changes in the external text editor and paste the revised HTML code into the appropriate fields using the HTML Editor window
- “Publish” the page and “View Live” to examine it again
- repeat the last two steps until the published page looks as desired
- use “Back to Page Manager” when finished
- the GooglePage with JS code has been created!
Do not open a GooglePage with active JS elements for editing in GPC, because JS code may become corrupted. If such a page needs to be edited, delete the existing page and re-create it from scratch as described above (using the backup or revised HTML code). The default “home” page cannot be deleted, if it needs to be recovered after a JS bug, therefore it is critical to learn about the uneditable field bug before adding JS code to the homepage.
Comments or questions? Contact GPX-Files or leave a comment for this post.
Links and trackbacks will be appreciated.
Entry Filed under: Developing Websites, Google, Google AdSense, Google Analytics, GooglePages, HowTo, JavaScript, Macromedia Flash, POSTED, StatCounter, Tutorial, Web 2.0, Websites, Widgets. .
6 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed

1. biohacker » JavaScript on GooglePages | July 15, 2006 at 3:04 am
[...] As creating GooglePages technically has little to do with biohacking, a brief how-to and all the follow-up information will be POSTED elsewhere. [...]
2.
udigis | June 20, 2007 at 3:55 am
This is quite helpful, thanks for sharing.
3.
dimension700x | October 10, 2007 at 3:06 pm
Hi I tried this and it didn’t work too well. I probably missed something.
I pasted the javascript code for AdSense onto a blank page. I didn’t see any buttons with html or anything so I just pasted it.
I saw the code in preview and then when I went to publish it, it stills showed the code. HOw do I get the ad words to publish properly?
Thank you.
dimension700x
4.
stormy | April 20, 2008 at 5:56 am
Yes, I’ve tested on my googlepages and works fine with java sript :-
http://stormyelites.googlepages.com
Thanks for nice share.
5.
richard | April 25, 2009 at 4:16 pm
If anyone was using google pages to host javascript or css files, you can easily use amazon s3 to host them. Just download s3fox for firefox and open a amazon s3 account, and you’re good-to-go.
richard @ allofcraigs
6.
I Caps | July 30, 2009 at 4:16 pm
Alternates of google pages to host files like javascript,mp3 etc. lots of choices with all the required details. Read it here
http://www.ialwayscapital.com/2009/05/alternatives-of-google-pages-file.html