Arran Pritchard
Arran Pritchard

Reputation: 75

Google Sites App script does not work with custom domain

I have an google app script embeded in my google site web page.

It works when I call the page using the native url https://sites.google.com/pritchardaccommodation.co.uk/wrexham/accomdetail

When I call it with the custom url https://www.pritchardaccommodation.co.uk/accomdetail

it gives the following error : script.google.com refused to connect.

Upvotes: 0

Views: 1827

Answers (1)

Arran Pritchard
Arran Pritchard

Reputation: 75

yes thank you postmaster that worked

function doGet(e) { return HtmlService.createTemplateFromFile("page").evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); }

but also I had to use a different url

enter image description here

the publish uses the URL: https://script.google.com/macros/s/AKfycbyP9B95KX6hVamCmN3CKVduZm1zLKyaQTG-WDbfhXp9JcOuePs1/exec

which does not work when embedded into a site with a custom URL.

instead I clicked the "Test web app for your latest code." which gives a different URL custom domain instead.

https://script.google.com/a/pritchardaccommodation.co.uk/macros/s/AKfycbxjlbdMmWRjVUESB6hexmN34v8fw7gLfWYY0FWXz1hd/dev

and then change the "dev" on the end to "exec:

Upvotes: 2

Related Questions