Converting Visitor to Member

TiG
TiG
@tig
5 years ago
184 posts
We are planning to build a module that caters to site visitors and makes it extremely easy for them to become members.

The first step is to find the best way to intercept a visitor accessing the site. The 'session_started' listeners are invoked multiple times on a single HTTP message from a single visitor (e.g. press F5 and the jrUser listener is invoked repeatedly). This leads me to think that this event is not the proper spot to insert a visitor conversion UI.

If there is an ideal spot to detect a visitor's first access of the site (the initiation of a visitor session) so that we can offer them a convenient conversion to member I would appreciate the insight.


--
TiG

updated by @tig: 12/03/19 01:41:37PM
michael
@michael
5 years ago
7,714 posts
'session_started' only fires once in the flow of loading a URL.

Maybe if you have some ajax on the page and are opening several URL's on a single page, that could cause it perhaps.

You could set a flag or a cookie or a session variable to prevent multiple whatever-you-want-to-do's happening per visit.

There's the 'router_init' event in router.php right after the session_init in flow of things. or 'parse_url' is just before the session start stuff.
TiG
TiG
@tig
5 years ago
184 posts
Okay, thanks Michael.


--
TiG
brian
@brian
5 years ago
10,148 posts
michael:
There's the 'router_init' event in router.php right after the session_init in flow of things. or 'parse_url' is just before the session start stuff.

NOTE: router_init is a new event in Jamroom Core 6.4.0+


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags