Signup Telemetry data

Background

For Signup and google signin flow telemetry events need to be generated and this documentation consists all the telemetry events for signup and google sigin flow.

Assumptions : 

  1. As all the below telemetry events are pre login events ,actor is not specified in the events and values of actor will be of below object value
    actor: {
    "id": "anonymous",
    "type": "User"
    }
  2. sid , did inside context will be same in all the events so they haven't mentioned in the all the events.

Proposed Solution

Use cases for signup flow :

1.when user clicks on signup button once it is landed to signup form


start event : Sample example
{
  "eid": "START",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "signup", "id": "<uuid>" }],
  },
  "edata": {
    "type":"signup",
    "uaspec":UASPEC,
    "pageid":"signup",
    "mode":"self"
  }
}


2. After landing on signup form in portal

Impression event : sample example
{
  "eid": "IMPRESSION",
  "context": {
    "channel": "0123166367624478721",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [
      {
        "type": "signup",
        "id": "<uuid>"
      }
    ]
  },
  "edata": {
    "type": "view",
    "pageid": "signup",
    "uri": "/signup"
  }
}

3. on click of signup button in the form 

interact event : sample example
{
  "eid": "INTERACT",
  "ver": "3.0",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "signup", "id": "<uuid>" }]
  },
  "edata": {
    "id": "submit-signup",
    "type": "click",
    "pageid": "signup",
	"extra": {
      "contactType":"<radio option selected value (email / phone)>"
    }
  }
}

4. After landing to otp page on clicking of signup submit


impression event : sample example
{
  "eid": "IMPRESSION",
  "context": {
    "channel": "0123166367624478721",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "signup", "id": "<uuid>" }],
  },
  "edata": {
    "type": "view",
    "pageid": "otp",
    "uri": "/sign-up"
  }
}


5. On clicking of submit otp in otp page


Interact event : sample example
{
  "eid": "INTERACT",
  "ver": "3.0",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "otp", "id": "<uuid>" }]
  },
  "edata": {
    "id": "submit-otp",
    "type": "click",
    "pageid": "otp",
    "extra": {
      "values":"/sign-up"
    }
  }
}


6. On clicking of resend otp in otp page


interact event : sample example
{
  "eid": "INTERACT",
  "ver": "3.0",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "otp", "id": "<uuid>" }]
  },
  "edata": {
    "id": "resend-otp",
    "type": "click",
    "pageid": "otp",
  }
}

7. on send otp fail after clicking on signup submit form


Interact Event : sample example
{
  "eid": "INTERACT",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "otp", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "otp",
	  "type": "click",
	  "id": "send-otp",
	  "extra": {
	    "isError":"true"
	  }	
  }
}

8. on resend otp api error 


Interact Event : sample example
{
  "eid": "INTERACT",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "otp", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "otp",
	  "type": "click",
	  "id": "resend-otp",
	  "extra": {
	    "isError":"true"
	  }	
  }
}


9. End event for : Signup submit api error / Error of submit otp (on api failure, not on invalid otp) / success of submit otp in signup flow


End event : sample example
{
  "eid": "END",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "signup", "id": "<uuid>" }],
  },
  "edata": {
    "type":"signup",
    "pageid": "signup",
    "mode": "self"
  }
}


Log events for signup flow :


1. On google invisble captcha suspicious event on signup submit

Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signup",
    "cdata": [ {"type": "signup", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signup",
	  "type": "api_access", 
	  "level": "ERROR", 
	  "message": "google captcha found suspicious"
  }
}

2. on otp verification fail after user has submitted otp


Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "otp", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "otp",
	  "type": "api_call", 
	  "level": "ERROR", 
	  "message": "otp verification failed"
  }
}

3. create user error after otp verified in signup flow


Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "signup", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signup",
	  "type": "api_call", 
	  "level": "ERROR", 
	  "message": "user creation failed"
  }
}

Google signIn flow


1.after landing to google page on click of signin with google from keycloak page  (is this really needed ?, as all the google signin flow events are been done in backend, and frontend have only google redirect pages)

Start event : sample example
{
  "eid": "START",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
    "type": "signup",
    "pageid": "signin",
    "uaspec": UASPEC,
	"mode":"google"
  }
}

2. After landing to google page after clicking of signin with google from keycloak page (this is a google page, impression can be created from backend when google gives the redirect url)


Impression event : sample example
{
  "eid": "IMPRESSION",
  "context": {
    "channel": "0123166367624478721",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
    "type": "view",
    "pageid": "signin",
    "uri": "/google/auth"
  }
}


3. After user action done on google sigin approved and google has given user details or denied


End event : sample example
{
  "eid": "END",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "sigin",
    "cdata": [ {"type": "sigin", "id": "<uuid>" }],
  },
  "edata": {
    "type": "signin",
    "subtype": "google_signin",
    "pageid": "sigin",
    "mode":"google"
  }
}


Log events of google signIn


1. on success full response of user details from google sigin 

Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "api_access", 
	  "level": "INFO", 
	  "message": "successfull recieved user details from google"
  }
}

2. on api error of google sigin to get redirect url

Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "api_access", 
	  "level": "ERROR", 
	  "message": "unable to get redirect url from google after user clicked on google signin button"
  }
}

3. on api error of google sigin to get user details from token

Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "api_access", 
	  "level": "ERROR", 
	  "message": "unable to get user details from auth token or <error response from google can be dumped here>"
  }
}

4. google signIn user already exists event

Log Event: sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "process", 
	  "level": "INFO", 
	  "message": "user exists"
  }
}

5. google sigin user not exists event 


Log Event : Sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "process", 
	  "level": "INFO", 
	  "message": "user not exists"
  }
}


6. create user error during signup using google


Log Event : sample example
{
  "eid": "LOG",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "otp",
    "cdata": [ {"type": "signin", "id": "<uuid>" }],
  },
  "edata": {
  	  "pageid": "signin",
	  "type": "api_call", 
	  "level": "ERROR", 
	  "message": "user creation failed"
  }
}

Audit Events : (what should be the values for edata audit events)


1.after user is created from self signup : 


audit event : sample example
{
  "eid": "AUDIT",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signup","id":"self"}],
  },
  "edata": {
	  "props": "",
	  "state": "", 
	  "prevstate": ""
  }
}


2. After user is created from google login : 


audit event : sample example
{
  "eid": "AUDIT",
  "context": {
    "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
    "pdata": {
      "id": "dev.sunbird.portal",
      "ver": "1.13.0",
      "pid": "sunbird-portal"
    },
    "env": "signin",
    "cdata": [ {"type": "signup","id":"google"}],
  },
  "edata": {
	  "props": "",
	  "state": "", 
	  "prevstate": ""
  }
}