Why dont see the user_engagement event in the event report in Firebase Analytics? - firebase-analytics

-Hello,
-I would like to understand why the user_engagement event is not see in the events report.

Related

eventOpenTrigger - Google appsscript only fire's the first time

Trying to build an addon for Google Calendar. When I first click on an event it triggers the eventOpenTrigger function. This works as expected.
If I click on another event again eventOpenTrigger triggers. If I then again click on the original event then eventOpenTrigger is not fired. Is this by design? Seems like this only triggers once for each unique event. I would like to update some information in the card every time the event is clicked on.
unfortunately there is no refresh from code, the action is bound to "eventOpenTrigger" when the calendar event is opened, if you want to re-run the function onCalendarEventOpen(event) you need to create an action such as
var action = CardService.newAction()
.setFunctionName('onCalendarEventOpen')
.setLoadIndicator(CardService.LoadIndicator.SPINNER)
you can provide a refresh button and add this action to button click, only this way i was able to get the event data that is required, if you do not want any event data and just need to call this function you can return onCalendarEventOpen from another and use calendar api to fetch the event details
const eventFromAPI = Calendar.Events.get(calendarId, eventId);
this is the only work-around i have been following

Installable trigger notify without change in the event

We are working on Google Calendar Add-on and need some help regarding Add-on development. We are using the triggers to notify the us whenever there is any create/update/delete happen on the google calendar. So, there is any create/update/delete event that occurred into the user calendar then the trigger should notify our service with data but in our case, it is not working as expected due to which incident occurred. It is giving 1000's of notification without actually changing in the event.
We are using Triggers->Installable Triggers for the notification service.

How to refresh appmaker table on change in calendar event of a calendar(dynamic) on current day?

I have created a app in appmaker. In that there is a table which should get refreshed (i.e a particular appscript function (client-side function)should run to refresh the table) whenever any change in calendar events of a particular calendar on the current day takes place.
How to set such type of trigger?
I did some R&D and found that there is something called watch function in calendar API but I'm not sure if it is useful for my problem.
By table I am referring to appmaker table widget.
If setting the appscript calendar trigger, Client refresh may be a problem. Because in my ui above the table there is a dropdown to select the calendarId which refreshes the table by running the below code:
var calendarId=app.pages.Events.descendants.Dropdown1.value;
google.script.run.withSuccessHandler(function() {
app.datasources.Events.load();
}).getTodayEvents(calendarId);
/* In getTodayEvents() current day events of the calendarId are
fetched from that calendar and stored in DB */
Can this happen from server side through trigger?
Also trigger should be based on the calendarId currently selected in dropdown.
So the calendarId needs to be dynamic in the trigger.
A calendar watch requires an webhook that will process some logic when there is an event modification(create, update, delete). Unfortunately, App Maker does not yet support such a thing and here is a discussion about it Calling App Maker server scripts from outside of App Maker UI. On top of that, you would require to interact with the client side rather than the server, so definitely not.
In this case, the best thing you can do is set an interval that will refresh the ui every certain seconds or minutes.
setInterval(function(){
app.datasources.myDatasource.load();
},60000); //60 seconds
A more advanced way of approaching this would be using firebase and cloud functions. I have implemented firebase on some projects with reliable results. You can read more about firebase and cloud functions on the below links:
https://firebase.google.com/docs/web/setup
https://cloud.google.com/functions/docs/
This may or may not be applicable to your use case but for non-app-maker script projects I'd do the following:
Go to your GSuite Developer Hub via https://script.google.com/home/my
Select the desired script project
On the right is a box titled "Project Details", click the menu icon (top-right) and select "Triggers"
Click the "Add trigger" button (bottom-right)
In the pop-up modal select the function you wish to run, and set the event source to "Calendar".
Note that this "Calendar" trigger can only detect updates to your primary calendar. Changes to secondary calendars you create will not be tracked.

Browser.msgBox(prompt) gives a timeout error

Browser.msgBox(prompt) gives a timeout error in Google SpreadSheet when the user does not press OK for a longer time.
I know I could use "toast()" , but with this option, the user will not be able to acknowledge the end of the execution and they might not know if the process has run or not.
What I would need is an option which does not timeout regardless the time until the user presses an OK button.
When using Browser.msgBox(prompt) the script will pause at this line until the Ok button is pressed the script is still running and the 6-minute timer ticking away.
If you are just using this to notify the user that the script has finished and not as some input to the script I suggest you use the HTML service as this will allow the script to end but remain on the screen until it is acknowledged by the user.

how to debug an event listener

Kindly help in debugging an event listener. I have written a popstate event listener to window object.
window.addEventListener('popstate',function);
The popstate event should be triggered when a browser back button is clicked but how however it get triggered when i add history using HTML5 history api.
history.pushstate();
How to debug an event listener which triggered the event or previous step of execution using firebug or other developer tools. Kindly guide me as I am new to UI development.
Can you get this information from the call stack if you put a breakpoint in your callback?
Also, note the docs indicate that popstate can be called more often then your question indicates:
The popstate event
A popstate event is dispatched to the window every time the active history entry changes. If the history entry being activated was created by a call to pushState or affected by a call to replaceState, the popstate event's state property contains a copy of the history entry's state object.
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history