Skip to content

Commit

Permalink
Merge pull request #40079 from code-dot-org/teacher-instrumentation-5
Browse files Browse the repository at this point in the history
Record lesson id when announcement is clicked on lesson plan
  • Loading branch information
dmcavoy committed Apr 20, 2021
2 parents e70d598 + eb40d8c commit 99c6671
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/src/templates/Notification.jsx
Expand Up @@ -201,7 +201,7 @@ class Notification extends Component {
// Our firehose logging system has standalone fields for commonly used metadata (eg, user_id).
// Here, we separate out those fields from any other analytics data provided in the firehoseAnalyticsData prop.
// We include these properties in the data_json object as well, in case that is easier for our product team to use.
['user_id', 'script_id'].forEach(firehoseMetadataKey => {
['user_id', 'script_id', 'lesson_id'].forEach(firehoseMetadataKey => {
if (firehoseMetadataKey in firehoseAnalyticsData) {
record[firehoseMetadataKey] =
firehoseAnalyticsData[firehoseMetadataKey];
Expand All @@ -220,7 +220,7 @@ class Notification extends Component {
})
};

firehoseClient.putRecord(record);
firehoseClient.putRecord(record, {includeUserId: true});
}
if (this.props.onButtonClick) {
this.props.onButtonClick();
Expand Down
3 changes: 3 additions & 0 deletions apps/src/templates/lessonOverview/LessonOverview.jsx
Expand Up @@ -155,6 +155,9 @@ class LessonOverview extends Component {
announcements={announcements}
width={styleConstants['content-width']}
viewAs={viewAs}
firehoseAnalyticsData={{
lesson_id: lesson.id
}}
/>
)}
{displayVerifiedResourcesNotification && (
Expand Down

0 comments on commit 99c6671

Please sign in to comment.