Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add video and discussion analytics #93

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

saeedbashir
Copy link

Description

Jira Ticket: LEARNER-10275

This PR adds the following new analytics:

Video Related Analytics

  • Video:Loaded
  • Video:Change Speed
  • Video:Played
  • Video:Paused
  • Video:Completed

Discussions Related Analytics

  • Discussion:Post Created
  • Discussion:Response Added
  • Discussion:Comment Added
  • Dicussion:Post Follow Toggle

The calling of following analytics has been addressed:

  • Logistration:Courses Search
  • Logistration:Explore All Courses

@rnr
Copy link
Collaborator

rnr commented Nov 5, 2024

@saeedbashir please look on failed Tests. Thank you

}

private func trackVideoPlayed() {
analytics?.videoLoaded(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should use videoPlayed here?

@saeedbashir saeedbashir requested a review from rnr November 6, 2024 05:41
Copy link
Collaborator

@rnr rnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you

@@ -89,6 +90,7 @@ public struct StartupView: View {
searchQuery: searchQuery,
sourceScreen: .startup
)
viewModel.logAnalytics(searchQuery: nil)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
We can replace:

func logAnalytics(searchQuery: String?)

with:

func logAnalytics(searchQuery: String? = nil)

It will avoid to pass mandatory nil parameter:

viewModel.logAnalytics(searchQuery: nil)

To:

viewModel.logAnalytics()


func videoPlayed(courseID: String, blockID: String, videoURL: String)

func videoChangeSpeed(
Copy link

@shafqat-muneer shafqat-muneer Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't videoSpeedChange be more appropriate?

topicID: topicID,
postType: postType,
followPost: followPost,
author: storage?.user?.username ?? ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In trackCommentAdded( & trackResponseAdded(, we are using author as newComment.authorName but in analytics?.discussionCreateNewPost(, we are using storage?.user?.username as an author attribute. Is it intentional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's intentional.

In trackCommentAdded( & trackResponseAdded(, we are using author as newComment.authorName
At these locations, new comment and new response object is available so authorname is available there so using

but in analytics?.discussionCreateNewPost(, we are using storage?.user?.username as an author attribute. Is it intentional?

Newly created thread object is not available so using the logged in user detail as user created the thread.

@saeedbashir saeedbashir merged commit 2463666 into 2U/develop Nov 13, 2024
2 checks passed
@saeedbashir saeedbashir deleted the saeed/LEARNER-10275 branch November 13, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants