UNAmedia Help

Documentation & Support

User Tools

Site Tools


ue5-google-analytics:universal-event-duration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ue5-google-analytics:universal-event-duration [2022/09/01 12:23]
Staff created
ue5-google-analytics:universal-event-duration [2022/09/01 12:48] (current)
Staff ↷ Page name changed from ue5-google-analytics:universal-events-duration to ue5-google-analytics:universal-event-duration
Line 10: Line 10:
       * //Scope//: //Hit//;       * //Scope//: //Hit//;
       * //Formatting Type//: //Time//       * //Formatting Type//: //Time//
-      * (in this example we set the //Name// to //duration//);+      * (in this example we set the //Name// to //duration//)\\ {{ :ue5-google-analytics:editcustommetric-duration.png |}}
     - **important** take note of the Custom Metric //index// (it's 1-based), from the //Example Codes for This Metric// box;     - **important** take note of the Custom Metric //index// (it's 1-based), from the //Example Codes for This Metric// box;
   - in your application code, log the //duration// metric for the desired events:   - in your application code, log the //duration// metric for the desired events:
Line 16: Line 16:
     - add the calculated duration to a logged event (e.g. using ''Record Structured Event''):     - add the calculated duration to a logged event (e.g. using ''Record Structured Event''):
       - add it as an event //Attribute//;       - add it as an event //Attribute//;
-      - **important** as key use the string ''cm<index>'', where <index> must be substituted with the Custom Metric //index// discussed above. For example: ''cm1''.+      - **important** as key use the string ''cm<index>'', where <index> must be substituted with the Custom Metric //index// discussed above. For example: ''cm1''.\\ {{ :ue5-google-analytics:recordstructuredevent-custommetric.png |}}
  
 GA will now be able to receive and sum all the //durations// you sent. GA will now be able to receive and sum all the //durations// you sent.
Line 28: Line 28:
     - in your Google Analytics Property //View// settings, select //Calculated Metrics//     - in your Google Analytics Property //View// settings, select //Calculated Metrics//
     - select //New Calculated Metric//;     - select //New Calculated Metric//;
-    - set the formula to: ''%%{{duration}} / {{Total Events}}%%'' (assuming your Custom Metric is called ''duration'').+    - set the formula to: ''%%{{duration}} / {{Total Events}}%%'' (assuming your Custom Metric is called ''duration'')\\ {{ :ue5-google-analytics:editcalculatedmetric-duration.png |}}
  
 This will allow GA to calculate the average duration for a group of events. The sum of ''duration'' and ''Total Events'' will be computed on the specific grouping of data displayed by Google Analytics. This will allow GA to calculate the average duration for a group of events. The sum of ''duration'' and ''Total Events'' will be computed on the specific grouping of data displayed by Google Analytics.
Line 35: Line 35:
  
 You can now use both the //Custom Metric// and the //Aggregated Statistic// in your reports. You can now use both the //Custom Metric// and the //Aggregated Statistic// in your reports.
-The example below is for a //Custom Report// where data are filter for a specific //Event Action// name, with resulting events grouped by the //Event Label// string, with outputs showing the calculate custom //Average Duration// (in addition to the used //Totale Events// and //duration// inputs used). 
  
 +The example below is for a //Custom Report// where data are filter for a specific //Event Action// name, with resulting events grouped by the //Event Label// string, with outputs showing the calculate custom //Average Duration// (in addition to the associated //Total Events// and //duration// inputs used by GA to compute the formula).
 +
 +{{ :ue5-google-analytics:customreportsetup-duration.png |}}
 +
 +This is an example of the corresponding output:
 +
 +{{ :ue5-google-analytics:customreportresult-duration.png |}}
 +
 +GA collects all the events satisfying the //filter//, group them accordingly to our configuration and for each resulting group it sums matching logged //duration// values and then compute the //Average Duration//.
ue5-google-analytics/universal-event-duration.1662027821.txt.gz · Last modified: 2022/09/01 12:23 by Staff