• How to send connection and stream statistics to Google Analytics (ModuleAnalytics)

    You can configure the ModuleAnalytics module on a Wowza media server application to send data to Google Analytics automatically. Each application can be configured to send data to the same Google account or to separate accounts. When viewed in Google Analytics, this data provides information about your applications and application instances so you can better understand how your content is used. Gathered statistics include the number of connections per stream and per protocol (for example, to see who is watching RTMP versus HLS streams) and how long the viewer is watching that content.

    Note: Wowza Streaming Engine™ software is required.
    A compiled version of this module is included in the Wowza Modules Collection.


    You'll need your domain and account ID from Google Analytics. You can find this by going to "All Accounts." The list that remains will have a small number to the right of it in xx-xxxxxxx-x format.


    To enable this module, add the following module definition to each application that you want to track. See Configure modules for details.
    Fully Qualified Class Name
    ModuleAnalytics Send statistics to Google Analytics. com.wowza.wms.plugin.collection.module.ModuleAnalytics


    Use the following properties to configure the module. See Configure properties for details.

    These properties can be set at the server level or the application level. Application-level properties will override the same property name set at the server level.
    Root/Server or Root/Application wowzalyticsGACode String UA-xxxxxxxxx-1 Account ID associated with given domain (default: not set).
    Root/Server or Root/Application wowzalyticsGADomain String example.com Domain name being tracked (default: not set).
    Root/Server or Root/Application wowzalyticsGAHost String wowza.example.com Host name being tracked (default: not set).
    Root/Server or Root/Application wowzalyticsGAPrefix String myPrefix Optional prefix to use for this application (default: not set).
    Root/Server or Root/Application wowzalyticsStatsNotificationUrls String http://stats.example.com/stats.php Optional comma-separated list of URLs to send the stats to. If used, these URLs must be able to accept the requests (default: not set).
    Root/Server or Root/Application wowzalyticsDebug String false Enable extra debug logging (default: false).

    The following properties can only be set at the server level and control the threads that send the data to the Google Analytics service.
    Root/Server wowzalyticsThreadPoolSize Integer 5 Number of threads used to send data (default: 5).
    Root/Server wowzalyticsDelayForFailedRequests Integer 1000 Time in milliseconds to wait between failed requests (default: 1000).
    Root/Server wowzalyticsHTTPMaxRetries Integer 5 Number of times to retry a failed request before giving up (default: 5).
    Root/Server wowzalyticsThreadPoolTerminationTimeout Integer 5 Number of seconds to wait when shutting down to allow all requests to be sent (default: 5).


    Google Analytics will report these connections in real-time and historically. To see the real-time connections, you can simply navigate to your domain project in Analytics, and click content under Standard Reports > Real-Time > content. You will see connections formatted as protocol[event]-streamname. For example: RTMPConnect-teststream.

    For historical reference, you can navigate to Behavior Flow > Site Content > All pages, and review similar information for the date range you've selected. This reference will include the application instance as part of the statistic.

    Wowza media server software and all components, including modules, source code, and other related items offered on this page, are copyrighted (c) 2006-2015 by Wowza Media Systems, LLC, all rights reserved, and are licensed pursuant to the Wowza Media Software End User License Agreement.
    Originally Published: For Wowza Streaming Engine on 02-02-2015.

    If you're having problems or want to discuss this article, post in our forum.