Skip to content
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
This repository was archived by the owner on Sep 4, 2019. It is now read-only.

Add support for track type "screen" #398

Description

@abdelbolanos

Hi,
For add support to track type "screen" this has to be added

plugin/src/blackberry10/index.js

--just below case "item"

case "screen":
optionString += "&t=screenview";
optionString += getParameter(args, "an", "appName");
optionString += getParameter(args, "av", "appVersion");
optionString += getParameter(args, "aid", "appId");
optionString += getParameter(args, "aiid", "appInstallerId");
optionString += getParameter(args, "cd", "screenName");
break;

and in plugin/www/client.js

--just below _self.trackTransaction = function

//Screen hit tracking,
//
_self.trackScreen = function(screenName, appName, appVersion, appId, appInstallerId){

    var result = 'Missing screenName parameter';

    if (screenName)
    {
        appName = appName || "";
        appVersion = appVersion || "";
        appId = appId || "";
        appInstallerId = appInstallerId || "";

        var success = function (data, response) {
                //result = data;
                result = "";
            },
            fail = function (data, response) {
                console.log("Error: " + data);
                result = "Error: " + data;
            };
        exec(success, fail, _ID, "trackAll", {
            "trackType": "screen",
            "screenName": screenName, 
            "appName": appName,
            "appVersion": appVersion,
            "appId": appId,
            "appInstallerId": appInstallerId 
        });
    }       
};

This will allow to track screens in GA
Example:

var screenName = encodeURIComponent('My Screen 1');
var appName = blackberry.app.name;
var appId = blackberry.app.id;
var appVersion = blackberry.app.version;
sError = community.googleanalyticsplugin.trackScreen(screenName,appName, appVersion, appId);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions