--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a1e0df97-82c2-4064-a014-20486d48711e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Do this:var user = Session.getActiveUser().getEmail() || Session.getEffectiveUser().getEmail();
On Thu, Jul 11, 2019 at 6:39 AM Medhat Nawras <alexa...@gmail.com> wrote:
--Hi all,I'm a total newbie to Google Apps Script and I'd like to know if there's a way to track all the emails of those within my corporation domain who visited my sheet since its creation to the time being. I tried out getViewers() method but what I found that it detected the viewer who was watching the sheet only at the time I executed the script (which was actually me! :) )Here's the simple code I wrote to try it out:function viewViewer() {
var ss = SpreadsheetApp.getActive();
var know = ss.getViewers();
Logger.log(know);
} Your contribution here is greatly appreciated
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
If you want to track them at the time they're viewing, Vinicius's way will work.Session.getActiveUser().getEmail() is the person using it, so when you you're testing as yourself it's you.Session.getEffectiveUser().getEmail(); is the person that app is running as, which depending on your publish settings will be yourself or the person using it.
So when testing both these answer will it will show your alias for both. You'd need to test it via another account to show different.
On Thursday, 11 July 2019 16:39:59 UTC+1, Medhat Nawras wrote:
Hi Vinicius. Thanks for your response.The log showed only my alias, the same thing that happened with the intitial script, although the activity dashboard showed some viewers who visited my sheet at a given time.Thanks
On Thursday, July 11, 2019 at 3:13:29 PM UTC+2, Vinicius Mello da Silva wrote:
Do this:var user = Session.getActiveUser().getEmail() || Session.getEffectiveUser().getEmail();
On Thu, Jul 11, 2019 at 6:39 AM Medhat Nawras <alexa...@gmail.com> wrote:
--Hi all,I'm a total newbie to Google Apps Script and I'd like to know if there's a way to track all the emails of those within my corporation domain who visited my sheet since its creation to the time being. I tried out getViewers() method but what I found that it detected the viewer who was watching the sheet only at the time I executed the script (which was actually me! :) )Here's the simple code I wrote to try it out:function viewViewer() {
var ss = SpreadsheetApp.getActive();
var know = ss.getViewers();
Logger.log(know);
} Your contribution here is greatly appreciated
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a1e0df97-82c2-4064-a014-20486d48711e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d523c3ad-45bf-4c41-bc8c-b6ba4c120ebf%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAGUAyam2OhD1FXetU-uSd59sYTo0rrUoABbLd%2B1gyLOQGcxkmA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a1e0df97-82c2-4064-a014-20486d48711e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d523c3ad-45bf-4c41-bc8c-b6ba4c120ebf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.