Hi, I need expert assistance here please. Two questions: 1. Where would one store JS code to run every time a Glide app is launched? and 2. Where can I put JS code that will run on every single page? Many thanks!
JS code write into the JavaScript column… there is no such thing as running every single page… what do you mean by that?
You can copy the response to every table.
Hi Andre. Glide isn’t a traditional website builder where you could run JavaScript on each page or when the website first loads.
Have you looked at the Google Tag Manager integration? I’ve never used that integration, but it’s the closest I can think of that might allow you to run tags in your app.
JavaSript will run as soon as you open the App… unless you put some conditions for execution
You put the code on tables, not on pages… pages run on tables… (just simplifying).
If you run the code on the Users table, you can access it from anywhere without copying it.
@nathanaelb I start feeling bad for contradicting you so many times…
I want you to know that I really like you…
No worries at all Uzo!
I don’t think our comments contradict each other. Correct me if I’m mistaken of course, but the way I see it, JavaScript in Glide is used in tables to compute data. I don’t think this is what Andre is looking for.
The way I interpret Andre’s question, running JavaScript upon launch and on each page, is because he probably wants to insert JavaScript tags for tracking, social media, marketing and whatnot. This is a feature available on many website builders, but not Glide. So in the spirit of the question, I feel like what comes closest to maybe answering the question is looking at the Google Tag Manager integration. The Google Analytics and Mixpanel integrations might also do if what’s needed is tracking, but I feel GTM would cover more.
Thanks very much to both of you, I will try and revert asap
Oh, now I get what you mean. Yep, that makes sense.
So… for others to understand Glide better… imagine that the Front editor is your HTML file…
Table editor, you divide into Computing columns… which would be your JS file and Static columns… your Storage/Database…SQL.
Thread was renamed to a shorter version, it contained the full post before.
Thanks Nathaneal and Uzo, I sincerely appreciate your consideration! I should have included our objective. We are looking to find a workaround for a Glide shortfall. Glide doesn’t terminate the session on closing a browser window and returns a User to the open App when the User decides to come back. This is obviously a huge security oversight. We’re looking to inject some simple JS code to address this flaw but aren’t sure where on Glide it resides. Please could you assist or suggest another way to overcome the security issue, thanks
I cannot think of anything to force a logout, sorry
Aren’t we missing a setting?
Always set authentication cookie
Users stays signed in until they do something (which we cannot control).
This is the default.
Asking users for consent
If users select “Keep me signed in”, something we cannot control, then they will stay signed in until they do something (back to the case above).
The checkbox here is also out of our control.
Aren’t we missing
Never set authentication cookie & force sign out after [n] minutes of inactivity
or something like that?
Yeah, I guess ideally in this case, the user wouldn’t be given a choice when they sign in, so a third option would make sense. Probably worth it a feature request.
Unfortunately there is no logout action that I know of. The sign-out button is a little hidden in the hamburger menu and unlikely to be used that often or remembered.
can the new custom code component be used for a custom tracker similar to a Google tag? I put the same snippet on every page.