[TIMOB-17077] BlackBerry: Analytics - ti.enroll event is not sent to the payload
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-06-05T17:42:57.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | Release 3.3.0 |
Components | BlackBerry |
Labels | analytics, qe-3.3.0, qe-testadded, regression |
Reporter | Olga Romero |
Assignee | Pedro Enrique |
Created | 2014-06-04T22:51:39.000+0000 |
Updated | 2014-07-25T17:53:16.000+0000 |
Description
Testing Analytics, we encountered that "ti.enroll" event is not being sent.
As a result, we do not see BB installs on a dashboard.
It is a regression.
Please, compare attachments.
Tested the following code
var apm = undefined;
try { apm = require("com.appcelerator.apm"); }
catch (e) { Ti.API.info("com.appcelerator.apm module is not available"); }
apm && apm.init();
var win = Ti.UI.createWindow({backgroundColor:'white'});
var startDate = new Date();
if (Ti.UI.Android){win.windowSoftInputMode = Ti.UI.Android.SOFT_INPUT_ADJUST_PAN;}
function timeOut(){setTimeout(function(){if(Ti.Platform.osname == 'ios' || 'android'){label.text = Ti.Analytics.lastEvent;}},1000);}
function createRow(i) {
var row = Ti.UI.createView({backgroundColor: 'white', width:'100%', height: '10%', top: 5, left: 0});
return row;
}
var column1 = Ti.UI.createView({top: 0, left: 0, layout: 'vertical', height:"60%", width:'33%'});
var column2 = Ti.UI.createView({top: 0, layout: 'vertical', height:"60%", width:'33%'});
var column3 = Ti.UI.createView({top: 0, right: 0, layout: 'vertical', height:"60%", width:'33%'});
if(Ti.Platform.osname == 'android'){
var label = Ti.UI.createLabel({backgroundColor:'#FFF', color:'black', textAlign: 'center', bottom:0, width: '98%', height:'40%'});}
else{
var label = Ti.UI.createLabel({backgroundColor:'#FFF', color:'black', font: {fontSize: 11}, textAlign: 'center', bottom:0, width: '98%', height:'40%'});}
var border = Ti.UI.createLabel({top:0, height:'1', borderColor:'#EEE', width: Titanium.UI.FILL});
var deprecated = Ti.UI.createLabel({backgroundColor:'#FFF', color:'red', textAlign: 'center', bottom:0, width: Titanium.UI.FILL});
//Testing the Ti.Analytics.addEvent
var testOneButton = Ti.UI.createButton({title: "addEvent", height: '33%', color:'red', width: '100%', top: 0});
testOneButton.addEventListener('click', function(e){
Ti.Analytics.addEvent('addEventOne', 'addEventTwo', 'addEvent.testButton');
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Add Event"; }
deprecated.setText("Deprecated 2.0.0");
win.add(deprecated);
});
//Testing the Ti.Analytics.getLastEvent
var testTwoButton = Ti.UI.createButton({title: "getLastEvent", height: '33%', width: '100%', top: 0});
testTwoButton.addEventListener('click', function(e){
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Get Last Event"; }
win.remove(deprecated);
});
//Testing the Ti.Analytics.getBubbleParent
var testThreeButton = Ti.UI.createButton({title: "getBubble", height: '33%', width: '100%', top: 0});
testThreeButton.addEventListener('click', function(e){
Ti.Analytics.getBubbleParent();
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Get Bubble Event"; }
win.remove(deprecated);
});
//Testing the Ti.Analytics.featureEvent
var testFourButton = Ti.UI.createButton({title: "featureEvent", height: '33%', width: '100%', top: 0});
testFourButton.addEventListener('click', function(e){
Ti.Analytics.featureEvent('featureEvent', {"value1":"key1"});
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Feature Event"; }
win.remove(deprecated);
});
//Testing the Ti.Analytics.navEvent
var testFiveButton = Ti.UI.createButton({title: "navEvent", height: '33%', width: '100%', top: 0});
testFiveButton.addEventListener('click', function(e){
Ti.Analytics.navEvent('navEventOne', 'navEventTwo', 'navEvent.testButton');
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Navigation Event"; }
win.remove(deprecated);
});
//Testing the Ti.Analytics.timedEvent
var testSixButton = Ti.UI.createButton({title: "timedEvent", height: '33%', color:'red', width: '100%', top: 0});
testSixButton.addEventListener('click', function(e){
var stopDate = new Date();
var duration = stopDate - startDate;
Ti.Analytics.timedEvent('timedEvent.testButton', startDate, stopDate, duration);
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Timed Event"; }
deprecated.setText("Deprecated 2.0.0");
win.add(deprecated);
});
//Testing the Ti.Analytics.settingsEvent
var testSevenButton = Ti.UI.createButton({title: "settingsEvent", height: '33%', color:'red', width: '100%', top: 0});
testSevenButton.addEventListener('click', function(e){
Ti.Analytics.settingsEvent('settingsEvent', 'settingsEvent.testButton');
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Settings Event"; }
deprecated.setText("Deprecated 2.0.0");
win.add(deprecated);
});
//Testing the Ti.Analytics.userEvent
var testEightButton = Ti.UI.createButton({title: "userEvent", height: '33%', color:'red', width: '100%', top: 0});
testEightButton.addEventListener('click', function(e){
Ti.Analytics.userEvent('userEvent', 'userEvent.testButton');
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "User Event"; }
deprecated.setText("Deprecated 2.0.0");
win.add(deprecated);
});
//Testing the Ti.Analytics.setBubbleParent
var testNineButton = Ti.UI.createButton({title: "setBubble", height: '33%', width: '100%', top: 0});
testNineButton.addEventListener('click', function(e){
Ti.Analytics.setBubbleParent(true);
if(Ti.Platform.osname != 'mobileweb'){ timeOut(); } else { label.text = "Set Event"; }
win.remove(deprecated);
});
column1.add(testOneButton);
column1.add(testTwoButton);
if(Ti.Platform.osname != 'mobileweb'){
column1.add(testThreeButton);
}
column2.add(testFourButton);
column2.add(testFiveButton);
column2.add(testSixButton);
column3.add(testSevenButton);
column3.add(testEightButton);
if(Ti.Platform.osname != 'mobileweb'){
column3.add(testNineButton);
}
if(Ti.Platform.osname != 'mobileweb'){ label.text = Ti.Analytics.lastEvent; }
label.add(border);
win.add(column1);
win.add(column2);
win.add(column3);
win.add(label);
win.open();
Attachments
File | Date | Size |
---|---|---|
3.3.0_bb_analytics.txt | 2014-06-04T22:51:39.000+0000 | 604 |
bb_payload.txt | 2014-06-04T22:51:39.000+0000 | 1728 |
Screen Shot 2014-06-09 at 2.13.12 PM.png | 2014-06-09T21:16:38.000+0000 | 15798 |
I've looking at the code and the payload and this is what's going on. When the app is starts up it looks for the analytics database file. If that file is not found, then it creates it and sends the "ti.enroll" event - this means that this is the first time the app runs after being installed. The problem is that when the app is uninstalled, the data that was saved does not get deleted and persists even if the app is not longer on the device. So when you install the app a second time, the analytics database exists from the previous install, and therefore the "ti.enroll" event is not sent when it should have been. The "workaround" would be to create a new app every time, or at least change the app id before running it and testing. I'll leave this ticket open for discussion and suggestions on how to accomplish this better.
[~penrique] I tested 5 applications with different guid before filing this ticket. Ready to discuss :)
I think I found the issue, it's something else. Working on it at the moment. Details to come
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/260
Tested with Appcelerator Studio, build: 3.3.0.201405271647 Titanium SDK, build: 3.3.0.v20140605150555
Actual result
ti.enroll event sent to the payloadTested and verified fixed: Mac osx 10.9.3 Mavericks Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140606154912 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-beta npm@1.3.2 titanium@3.3.0-beta2 titanium-code-processor@1.1.1 Device: BB Z10 (10.2.1) dashboard.appcelerator.com (please see screenshot)