Using a Google Script with Pages

Google Scripts are awesome as a multitude of different business applications can be built on top of them. Therefore it's great that you can also use them inside Universe Pages.

This article assumes you are familiar with Google Script.

Google Script needs 3 things to work with Pages. 1st you need to have a built UI for the script. 2nd you need to set the doGet(e) function output with setXFrameOptionsMode(). 3rd you need to publish the script. Lets go through the details below.

3. Publish the script

Publish the script from the top navigation bar under "Publish". From here select the "Deploy as web app". Set the necessary settings and grab the Current web app url from the form, its the one starting with https://script.google.com/macros/s/...

Now you can add a new iframe widget to your Universe Pages, copy the web app url as the source and you are all set!