NUS-ALSET / achievements

Assign 3rd party achievements for students to complete using the Learning Tools Interoperability protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Including query parameters in Logged Events

Thangamanir opened this issue · comments

When someone visits achievements with a query paramenter, include the query parameters in the logged events.
When loading Achievements with a specific route like this one, capture the parameter c=99 included in this url and save it as query/c/99 in the logged event.
https://achievements-prod.firebaseapp.com/?c=99/#/paths/-LJML2MVPrTOWQWyPHOd
https://achievements-prod.firebaseapp.com/?c=99/#/paths/-LJq6Qh3EOiSEG3xpu1f/activities/-LJq7_M7PYpa1SBSBScO
We can capture the parameter on initial load of the app. we can put the code at https://github.com/NUS-ALSET/achievements/blob/master/src/containers/AppFrame/AppFrame.js#L159 location
We need update actions service https://github.com/NUS-ALSET/achievements/blob/master/src/services/actions.js#L44 to keep these parameters.
Whenever a user navigates to a new route, any query parameters could be included in logged events related to changing routes such as changing path, changing course, etc.
With this feature and these types of urls, we could provide a link with ?c=99 or some other promo code and then see how many new users end up logging into Achievements with that promo code.
We will query for specific parameters in firestore or the realtime database by looking for the promo code as a parameter. For example:
activity_events=db.collection('logged_events').where('query.c','==',99)