Skip to content

Commit

Permalink
Merge pull request #1844 from 4dn-dcic/statistics_ga4_updates
Browse files Browse the repository at this point in the history
Statistics Page Updates
  • Loading branch information
utku-ozturk authored Sep 12, 2023
2 parents c113db4 + 055eeaf commit 8df668e
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 45 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ fourfront
Change Log
----------

6.4.2
=====

`Usage Statistics updates <https://github.com/4dn-dcic/fourfront/pull/1844>`_

* The graphs listed added to /statistics page: Top 10 Files Downloaded, File Details View, File Impressions, File Search Result Click, Metadata.tsv Downloads, Device Category
* Tracking Item schema updated for new reports generated by GA4 metrics: metadata_tsv_by_country, top_files_downloaded, sessions_by_device_category


6.4.1
=====

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
# Note: Various modules refer to this system as "encoded", not "fourfront".
name = "encoded"
version = "6.4.1"
version = "6.4.2"
description = "4DN-DCIC Fourfront"
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
license = "MIT"
Expand Down
132 changes: 127 additions & 5 deletions src/encoded/schemas/tracking_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,46 @@
"type" : "number",
"title" : "Sessions per User",
"description": "Number of sessions divided by number of unique users."
},
"ga:pageviews" : {
"type" : "integer",
"title" : "Pageviews"
}
}
}
},

"sessions_by_device_category": {
"type" : "array",
"title" : "User Sessions by Device Category",
"items" : {
"type" : "object",
"properties" : {
"ga:deviceCategory" : {
"type" : "string",
"title" : "Country"
},
"ga:sessions" : {
"type" : "integer",
"title" : "Session Count",
"description" : "Number of sessions from ga:deviceCategory for the given start->end date range."
},
"ga:avgSessionDuration" : {
"type" : "number",
"title" : "Avg. Session Duration"
},
"ga:bounceRate" : {
"type" : "number",
"title" : "Bounce Rate"
},
"ga:sessionsPerUser" : {
"type" : "number",
"title" : "Sessions per User",
"description": "Number of sessions divided by number of unique users."
},
"ga:pageviews" : {
"type" : "integer",
"title" : "Pageviews"
}
}
}
Expand Down Expand Up @@ -377,7 +417,7 @@

"file_downloads_by_country" : {
"type" : "array",
"title" : "File Downloads",
"title" : "File Downloads by Country",
"description": "File Downloads segmented by country",
"items" : {
"type" : "object",
Expand Down Expand Up @@ -419,15 +459,73 @@

"file_downloads_by_filetype" : {
"type" : "array",
"title" : "File Downloads",
"description": "File Downloads segmented by country",
"items" : {
"title" : "File Downloads by File Type",
"description": "File Downloads segmented by file type",
"items" : {
"type" : "object",
"properties": {
"ga:productVariant" : {
"type" : "string",
"title" : "File Type"
},
"ga:productDetailViews" : {
"type" : "integer",
"title" : "Detail Views",
"description": "Number of times this ExperimentSet has been viewed via its Item page."
},
"ga:productListClicks" : {
"type" : "integer",
"title" : "Clicks from Browse",
"description": "Number of times this ExperimentSet has been clicked on from the Browse page."
},
"ga:productListViews" : {
"type" : "integer",
"title" : "List Views",
"description": "Number of times this ExperimentSet has been seen present in a Browse or Search results page."
},
"ga:metric2" : {
"type" : "integer",
"title" : "Downloads"
},
"ga:metric1" : {
"type" : "integer",
"title" : "Cumalative Filesize"
},
"ga:calcMetric_PercentRangeQueries" : {
"type" : "integer",
"title" : "Range Query Count"
}
}
}
},

"top_files_downloaded" : {
"type" : "array",
"title" : "Top File Downloads",
"description": "Top File Downloads segmented by file",
"items" : {
"type" : "object",
"properties": {
"ga:productName" : {
"type" : "string",
"title" : "Item Title"
},
"ga:productSku" : {
"type" : "string",
"title" : "Item Accession"
},
"ga:productBrand" : {
"type" : "string",
"title" : "Lab Name"
},
"ga:productVariant" : {
"type" : "string",
"title" : "File Type"
},
"ga:productCategoryLevel2" : {
"type" : "string",
"title" : "Item Type of File"
},
"ga:productDetailViews" : {
"type" : "integer",
"title" : "Detail Views",
Expand Down Expand Up @@ -459,9 +557,33 @@
}
},

"metadata_tsv_by_country" : {
"type" : "array",
"title" : "Metadata.tsv Download by Country",
"items" : {
"type" : "object",
"properties": {
"ga:country" : {
"type" : "string",
"title" : "Country"
},
"ga:productListName" : {
"type" : "string",
"title" : "List Name",
"description": "The source where the metadata.tsv file is generated"
},
"ga:uniquePurchases" : {
"type" : "integer",
"title" : "Files Count",
"description": "Total files count included within the file"
}
}
}
},

"file_downloads_by_experiment_type" : {
"type" : "array",
"title" : "File Downloads",
"title" : "File Downloads by Experiment Type",
"description": "File Downloads segmented by country",
"items" : {
"type" : "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export default class StatisticsPageView extends React.PureComponent {
}

componentDidMount(){
const { onComplete } = this.props;

this.maybeUpdateCurrentTabFromHref();

if (!dynamicImports.UsageStatsView) {
Expand All @@ -73,7 +75,7 @@ export default class StatisticsPageView extends React.PureComponent {
});

});
} else {
} else if (onComplete && typeof onComplete === 'function') {
onComplete();
}
}
Expand Down
Loading

0 comments on commit 8df668e

Please sign in to comment.