# User Login and Registration Analytics Scripts
# Registration paths
- User can register on the site's register form
- User can register on site's register form by using social media
- User can be automatically registered by submitting one of the following forms in Luminate for the first time with their email (provided the email is not in the Luminate already):
- Survey
- Donation form
- TeamRaiser registration form (step 4)
- E-commerce checkout
- Sponsorship purchase (done via donation API)
# Login paths
- User can login using the site's login form
- User can login using social media on the site's login form
- User can login using the TreamRaiser login form
- User can be automatically logged in when they are automatically get registered
# Analytics data
We need to capture the following in the analytics:
- Is this a login or a registration?
- Is this a first time login (activation) or a repeated login (sign in)
- If social media was used, what network did they use to sign in?
# Member center requirements
- Did the user automatically registered by the system? And is this their first session?
- Is this user's repeated visit
# Code flow
- Login or register with social media
- Click on social media & select one.
setSocialMediaLoginInfo()sets a cookie with which social media we chose - Get redirected to the login page.
- Login page sets
stc-logged-incookie, so we know if the user is logged in. - Then the function
getUserInfoSetAnalytics()is called. This function- Gets user details from an API
- Gets user interactions from the API
- Decides what info to send to analtyics based on the first two calls
- Adds in social media info and deletes that cookie.
- Sets user info, including login type into the
stc-membercookie.
- Click on social media & select one.
# Code execution flow
getUserInfoSetAnalytics()getUserInteractions()retrieveUserIntreactions()parseUserInteractions()
getUserDetails()parseUserDetails()
setAnalyticsParameters()getSocialMediaFormType()getAnalyticsUserType()setUserAnalytics()
setUserAnalytics()