I have a Google Sheet that is using the Google Analytics Add-on.

I have a sheet in the spreadsheet that pulls data from the Google Analytics results to present it to a customer.

On this page are the dates that the GA reports addon uses to fetch the data.

I would like a button on this page so that if the customer updates date fields, they can press the button and regenerate the reports. Is this possible? I'd prefer that they don't have to navigate the menu to run the report (or wait until the hour has expired on the scheduled report).

The addon itself does not provide a function to update the report. So the menu appears to be the only way to get the report to run. However, I imagine that the menu item triggers a javascript function - is it possible to identify the javascript call bound to the menu item, then trigger that same call using a button on the spreadsheet?

  • In the spreadsheets jargon, Google Sheets handles spreadsheets; a spreadsheet could have one or several sheets. By "I have a page in the sheet" do mean "I have a sheet in the spreadsheet..."? Anyway, this looks more like a feature request to the add-on developer than a question for the community. Aug 2, 2016 at 22:40
  • 1
    Yes, sorry if that wasn't clear. Edited.
    – Paul
    Aug 2, 2016 at 23:59

1 Answer 1


Short answer

Yes, the menu triggers a JavaScript function but it's no exposed to the users so they can't call it from a button.


AFAIK the only way to interact with an add-on is through the exposed features like custom functions, custom menus or other elements added by the add-on.

When an add-on is open-source and the users are able to get the source code, they could use the source code instead of the add-on, then they could call the Google Apps Script function that updates the report by using a button.

  • This is the essence of my question. The update functionality is exposed through a menu, not a function. But I am presuming the menu calls a javascript function, and I am wondering if it is possible to figure out what this is and bind it to a button. I'll clarify in the question.
    – Paul
    Aug 3, 2016 at 0:41
  • @Paul: I updated the answer accordingly to the current version of the question. Aug 3, 2016 at 1:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.