# 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-in cookie, so we know if the user is logged in.
    • Then the function getUserInfoSetAnalytics() is called. This function
      1. Gets user details from an API
      2. Gets user interactions from the API
      3. Decides what info to send to analtyics based on the first two calls
      4. Adds in social media info and deletes that cookie.
      5. Sets user info, including login type into the stc-member cookie.

# Code execution flow

  • getUserInfoSetAnalytics()
    • getUserInteractions()
      • retrieveUserIntreactions()
      • parseUserInteractions()
    • getUserDetails()
      • parseUserDetails()
    • setAnalyticsParameters()
      • getSocialMediaFormType()
      • getAnalyticsUserType()
      • setUserAnalytics()
    • setUserAnalytics()