Add a button to the sheet to refresh data

14,703 views
Skip to first unread message

Rachel Factor

unread,
Dec 1, 2016, 1:32:09 PM12/1/16
to google-analytics-spreadsheet-add-on
Does anyone know how to run the add on using a button rather than interacting with the menu? I'm hoping to streamline a dashboard for a client and it would be way easier to just have them push a button.

Thanks!
Rachel

Forrest Wheatey

unread,
Jan 26, 2017, 6:55:02 AM1/26/17
to google-analytics-spreadsheet-add-on
Hey, I'm searching for the same thing. Sorry for not providing a solution, but have you found a way to do it?

Shonari Gow

unread,
May 3, 2017, 2:32:58 PM5/3/17
to google-analytics-spreadsheet-add-on
Looking for a solution as well

Carl Natale

unread,
May 4, 2017, 9:27:09 AM5/4/17
to google-analytics-spreadsheet-add-on
The add-on is in a silo that prevents being triggered by a script or formula. Google sees it as a security feature.

It's not exactly what you want but the add-on has a scheduling feature. I haven't been a fan of Google's scheduling features on the whole (not very reliable or timely), but this one for the add-on seems to be pretty reliable these days. 

Also, I was able to train a high-level manager to run the add-on when he wanted reports. A button would be better but a little bit of patience works too.

Shonari Gow

unread,
May 4, 2017, 9:41:37 AM5/4/17
to google-analytics-spreadsheet-add-on
I found a solution:

Create a script with the following and assign it to a button (any image inserted into the spreadsheet). Replace the various fillers as necessary (in red)

function myRecalculate() { 

// The code below opens a spreadsheet using its ID 
// Note that the spreadsheet is NOT physically opened on the client side. 
// It is opened on the server only (for modification by the script). 
var ss = SpreadsheetApp.openById("Put_Your_Spreadsheet_ID_Here"); 
var sheet = ss.getSheetByName("Support"); 
var cell = sheet.getRange('B1') 

cell.setValue(1

}

Done. Thats it!



On Thursday, 1 December 2016 13:32:09 UTC-5, Rachel Factor wrote:

Jono Ellis

unread,
May 16, 2017, 8:55:14 AM5/16/17
to google-analytics-spreadsheet-add-on
Hi Shonari, 
It looks like this script doesn't retrigger the Google Analytics spreadsheet addon... 
Reply all
Reply to author
Forward
0 new messages