Page and Interaction Metrics

Page and Interaction Metrics

These VQL examples include only charts and metrics for objects within a specific course: they often have the ID of the course as a filter. Each of the widgets represents either out-of-the-box (OOTB) metrics built-in to the LRS, or practical metrics our customers asked for. You can find the OOTB metrics in the Activity Overview dashboard of your LRS. For some of these examples, you can often use the regular Chart Builder to assemble an approximately similar widget.
Notes
We've collapsed some of the whitespace in the JSON in this article, to make it easier to read.

Top Ten Most Active Objects, for a Single Course

What objects (courses, lessons, questions...) are used the most, and how often were they used? (Click a pie wedge to focus on the object). This OOTB widget is the same as the one in the LRS Overview dashboard, except this instance shows objects in the most statements only for the selected course.



{   "title": "Recently Active Objects",
"subtitle": "What objects (courses, lessons, questions...) are <b>used the most</b>, and how often were they
used? (Click a pie wedge to focus on the object)",
"filter": {
"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning"},
"process": [{
"$frequentValues": {
"path": "object.id"}}, {
"$toCanonicalDisplay": {
"path": "_id"}}, {
"$pieChart": {
"categoryPath": "canonical.display",
"itemType": "activity"}}]}

Weekly Traffic, for a Single Course

For the top ten activities, what days of the week are they most often accessed? The LRS hides this OOTB widget if it has no data for the selected period. It’s the same as the widget in the LRS Overview dashboard, except this instance shows relative increases in statements only for the selected course.



{   "title": "Weekly Traffic",
"subtitle": "For the top 10 activities, what days of the week are they <b>most frequently</b> accessed?",
"filter": {
"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning"},
"process": [{
"$frequentValues": {
"path": "object.id"}}, {
"$query": {
"filter": {
"object.id": {
"$each": {
"$input": {
"path": "$[*]._id",
"mode": "all"}}}},
"process": [{
"$punchCard": {
"path": "timestamp",
"metrics": {
"score": {"$avg": "result.score.scaled"}}}}, {
"$group": {
"_id": "$day",
"dayOfWeek": {"$last": "$dayOfWeek"},
"count": {"$sum": "$count"},
"bar": {"$avg": 1}}}, {
"$addFields": {
"name": {"$context": {"path": "$.filter['object.id']" }}}}]}}, {
"$mergeArrays": {}}, {
"$sort": {"_id": 1}}, {
"$toCanonicalDisplay": {"path": "name"}}, {
"$project": {
"_id": "$dayOfWeek",
"name": "$canonical.display",
"activity": "$name",
"count": "$count"}}, {
"$heatChart": {
"categoryPathX": "_id",
"categoryPathY": "name",
"valuePath": "count",
"maxColor": "#00bbbb",
"minColor": "#FFF",
"linkIdPath": "activity",
"linkTitlePath": "name",
"itemType": "activity"}}]}


Activity Over Time Breakdown, for a Single Course

For the top ten activities, how is total traffic on each changing over time? The LRS hides this OOTB widget if it has no data for the selected period. It’s the same as the widget in the LRS Overview dashboard, except this instance shows changes in total statements for objects only in the selected course.


{   "title": "Activity over time breakdown",
"subtitle": "For the top 10 activities, how is <b>total traffic</b> on each changing over time?",
"filter": {
"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning"},
"process": [{
"$frequentValues": {
"path": "object.id",
"metrics": {
"activity": {
"$timeSeries": {
"path": "timestamp",
"span": "daily"}}}}}, {
"$toCanonicalDisplay": {
"path": "_id",
"mode": "activity"}}, {
"$serialChart": {
"categoryPath": "activity[*]._id",
"valuePath": "activity[*].count",
"lineCategory": "canonical.display"}}]}


Activity Over Time, for a Single Object

How is total traffic to this LRS changing over time? The LRS hides this OOTB widget if it has no data for the selected period. It’s the same as the widget in the LRS Overview dashboard, except this instance shows activity only for the selected object.



{   "title": "Activity over time",
"subtitle": "How is <b>total traffic</b> to this LRS changing over time?",
"filter": {
"object.id": "https://www.coursera.org/specializations/deep-learning/1"},
"process": [{
"$timeSeries": {
"path": "timestamp",
"span": "daily"}}, {
"$serialChart": {}}]}


Percent of Students Started, for a Single Course

The number of students that started the course. This is one of several widgets that a customer keeps in a row in a dashboard to show the status of a course. This widget filters on a parent and verb and counts the unique actors, counts a grand total for the verb alone, and then calculates the percentage. This widget shows the number of students who started the course versus those who started all courses. The percentage is more interesting than the count. A large percent (regardless of count) shows that students started this course as part of a general campaign: perhaps it’s a prerequisite course. A small percent (< 25%, and with a large count) shows that students take this course as a specialty.



{   "title": "Started Course",
"subtitle": "Deep Learning",
"process": [{
"$parallel": {
"stages": [{
"$query": {
"filter": {
"meta.relatedActivities": "https://www.coursera.org/specializations/deep-learning",
"verb.id": "http://adlnet.gov/expapi/verbs/initialized"},
"process": [{
"$range": {"path": "actor.id"}}]}}, {
"$query": {
"filter": {
"verb.id": "http://adlnet.gov/expapi/verbs/initialized"},
"process": [{
"$range": {"path": "actor.id"}}]}}]}}, {
"$mergeArrays": {}}, {
"$group": {
"_id": 1,
"values": {"$push": "$value"}}}, {
"$project": {
"value": {"$multiply": [{"$divide": ["$values.0", "$values.1"]}, 100] },
"total": "$values.0"}}, {
"$notice": {
"icon": "flag-o",
"title": "${value.value}%",
"subtitle": "The number of students that started the course is ${value.total.toFixed(0)} ",
"valuePath": "$",
"precision": 1}}]}





Notes
We're constantly receiving requests for new charts and metrics: check back often. Or, click the Follow button in the right menu to get email alerts when we update this article.