Give it a look at [plugin-session-sharing]:
https://community.nodebb.org/topic/7829/nodebb-plugin-session-sharing-session-sharing?_=1662848309040
Help Needed: Execute javascript for not logged in users
-
I would like to add/execute ad serving javascript (google adsense) only for users who are not logged in.
I installed the nodebb adsense plugin, but it is not configurable to detect whether users are logged in or not. So I am thinking about just adding the code block for google adsense via custom header and wrapping it in some javascript, so it's not executed when a user is loggedin. Help is appreciated.
-
@phenomlab Thanks, do you use HTML widget? ! I will try that and see if Google adsense does not mind not being inside the head tag.
-
@phenomlab it seems like it kind of works, but the ads are intermittently showing and only on the front page, although I put the widget in the global header. My guess as it's something related to the google adsense code not being inside the head tag. I will keep exploring the option of using custom header and try to figure out how to detect the guest users in javascript.
Suggested Topics
-
0 Votes2 Posts122 Views
-
0 Votes7 Posts319 Views
-
0 Votes4 Posts1219 Views
-
0 Votes3 Posts1972 Views
-
Error logs
Solved Technical Support0 Votes1 Posts722 Views