Embedding web app in Google Sites doesn't work - google-apps-script

I have Google Apps Script deployed as "web app" linked to a spreadsheet google.
It displays a form and once you submit the form, it will process the data and put it in the spreadsheet, here the code :
https://docs.google.com/spreadsheets/d/1EBo5DooJQtcFX5GORmtOB1ri2kkMPXX6nEMvNRsobOg/edit?usp=sharing
When I access the script directly via the link below there's no problem, it's working fine :
https://script.google.com/macros/s/AKfycbyMu10ibB8dBLZj6hS_gfNSiaW4XxEnFuzVOvNHdQKcoX092Ayy/exec
But when I want to embedded like "web app" in google site like this, it doesn't work :
Do you have any idea why it doesn't work?
EDIT :
It's odd but when I tried to make a mock website (with the new version of Google site) to show you the problem, it's working :
https://sites.google.com/ggbearings.com/test/home
But it's not working on classic Google site, I guess I have to contact them to seek out an answer.

Related

Apps Scripts within Google Sites

So I might be doing this entirely wrong, but I am trying to create a slideshow based on images stored in a google drive folder that can be easily added (ie by a non-technical person) to a google site.
I created a script that outputs the slideshow using the HTMLService. You can view the working site at https://script.google.com/a/macros/needham.k12.ma.us/s/AKfycbyOyqTr_sEMWRVBn0e0r4NV5083_LwzZSMYwPU-25_xd2m6ZexS/exec?width=300&height=200&folderID=0B-6QUsY0bQG5ZmI4QTl4T1ZQZmc
When I try to insert this script into a google site using the Apps Script Gadget (Screenshot 1) using the link above it appears that the parameters are either lost or ignored (Screenshot 2). When I hard code the parameters into the script, the slideshow loads correctly (Screenshot 3).
Screenshot 1
Screenshot 2
Screenshot 3
You cannot add the parameters to the URL when inserting your script in a Google Site. However, you can pass the parameters to the Site URL utself and the script will pick it up.
For example,
http://sites.google.com/example.com/example-site/example-page?folderID=1235
As for the width and the height, you can adjust them when you insert the script into a Site using controls that Google Sites provides
Same happened to me. My solution was to write a google gadget that iframed my apps script and added fhe necesary parameters.

Google Apps Script Web App on my Domain

I had built a Google UI Apps Script in my Drive account. It works great.
I would like to embed it on my domain. I know that I can embed it as a gadget on a Google site, but I don't want Google's URL appearing in my website.
I have a word-press site and I would like to embed this UI script into a page/post on my word-press site or create a stand alone page on my domain with this script on it.
Is this possible?
I just don't want my users to be redirected off my site and see the long ugly domain of https://script.google.com/a/macros/*************
Any suggestions?
This isn't currently supported.
See (duplicate) Embedding Google Apps Script WebApp in WordPress Page.
Visit Issue 852 and star it for updates. (There are also some potential work-arounds described in the issue comments.)

URL parameters stripped on Google Sites?

Using Google Apps Script gadget, I can use the parameters of the URL (http://sites.google.com/.../my-page?urlparameter=value&otherurlparameter=value) added to a Google Sites webpage to generate dynamic content.
But if you try to add a link to a page of a Google Site with parameters, and then save your page, the parameters are deleted : http://sites.google.com/.../my-page?urlparameter=value&otherurlparameter=value becomes http://sites.google.com/.../my-page. Same thing when trying to publish a webpage using Apps Script Service SitesApp.Page.setHtmlContent(yourHmtl).
It doesn't happen when using external URLs.
How can we bypass this limitation ?
It's possible to include relative links to pages including parameters.
Example :
in http://sites.google.com/.../home/page-1,
a link like http://sites.google.com/.../home/page-2?urlparameters will be overwritten without parameters but ../page-2?urlparameters won't be.

Minor issue when sharing custom document

I've integrated the Google Drive share dialog and it works like a charm.
The only minor issue that I came across is that the notification email contains a broken icon.
It would be ideal if the proper icon for my custom mimetype (as configured in the Google API Console) would be used.
This is how the notification mail looks like:

Apps Script Gadget not working on a custom website

i have this problem, and it seems that i'm not alone.
If i embed a simple apps script form with some textarea,buttons and labels in a custom web url www.mydomain.com/mypage...the page simply don't show nothing and the Chrome console report that error:
Refused to display document because display forbidden by X-Frame-Options.
Instead if i see the page from the original url:
https://sites.google.com/a/mydomain.com/mysite/mypage
i see the apps script correctly.
Anyone solved that problem or can tell me a workaround??
Thank you
This is a known issue and there has been a lot of chatter on this topic. Here is the issue filed in issue tracker. You may star it. People have listed some workaround as well.
Google Apps Script Gadget not working with custom web address mapping