Custom events aren't being recorded anymore. (Android)

262 views
Skip to first unread message

abhi...@quintoapp.com

unread,
Mar 25, 2016, 7:37:44 AM3/25/16
to CleverTap Support
I'm not quite sure about what caused it, but my custom events aren't being recorded anymore on CleverTap. Only the default events are captured, viz. App launched, Stayed, etc.

Below is a class which includes the code to push an event along with an object containing some values.
public class CustomEvent extends AsyncTask<Void, Integer, String> {
   
private HashMap<String, Object> customEvent;
   
private CleverTapAPI cleverTap = null;
   
private String val1, val2;
   
   
private Context context;

   
public CustomEvent(Context context, String myValue1, String myValue2) {
       
this.context = context;
       
val1  = myValue1;
        val2 = myValue2;
   }


   
protected String doInBackground(Void... arg0) {


       
try {
           
cleverTap = CleverTapAPI.getInstance(context);
       
} catch (CleverTapMetaDataNotFoundException e) {
           
// handle appropriately
        } catch (CleverTapPermissionsNotSatisfied e) {
           
// handle appropriately
        }
       
customEvent = new HashMap<String, Object>();
       
if (val1 != null)
           
customEvent.put("val1", val1);
       
if (val2 != null)
            customEvent.put("val2", val2);
           
        customEvent.put("id", "1");

       
cleverTap.event.push("My Event", customEvent);
       
return null;
   
}


}


Further, i call this method by this code..
new CustomEvent(this, val1, val2).execute();

Debugging the above, 
cleverTap.event.push
is called without any issues along with custom values. However, CT Dashboard does not show my custom event presence.


CleverTap Support

unread,
Mar 25, 2016, 9:02:10 AM3/25/16
to CleverTap Support
Is it running in segment mode?  event.push() api is actually no-op in this case.  Please check manifest xml for the below line.

<meta-data android:name="CLEVERTAP_SEGMENT" android:value="true"/>;

if not, set debug level to "finest" and see if it helps.

CleverTapAPI.setDebugLevel(Constants.DEBUG_FINEST)

abhi...@quintoapp.com

unread,
Mar 25, 2016, 9:12:46 AM3/25/16
to CleverTap Support
Yes, the segment meta data is there in my manifest.
What is the integer value for finest? Couldn't find it in the doc.

CleverTap Support

unread,
Mar 25, 2016, 9:20:36 AM3/25/16
to CleverTap Support
Please remove that.  It's meant to be for segment.io users only. ( Are you? )

it should just work after that.

it's java constant. Constants.DEBUG_FINEST
(com.clevertap.android.sdk.Constants.java)
Message has been deleted
Message has been deleted

abhi...@quintoapp.com

unread,
Mar 25, 2016, 9:52:28 AM3/25/16
to CleverTap Support
I'm using CleverTapAndroidSDK-v2.0.5-20160109.jar. There isn't any class called Constants.java inside the package com.clevertap.android.sdk. Secondly, removing the segment meta data tag does not help. Moreover, that tag has been there previously as well, and the event recording part was working absolutely fine with that tag before.

CleverTap Support

unread,
Mar 25, 2016, 10:02:59 AM3/25/16
to CleverTap Support
ok, here's the value for the finest debugging 1277182231

would you mind moving into latest sdk?


read about the segment tag here.

It's not required if you aren't using segment. And the event push is no-op. ( silently consumes but doesn't fire events )



abhi...@quintoapp.com

unread,
Mar 26, 2016, 10:14:40 AM3/26/16
to CleverTap Support
Your latest sdk does not include the class Constants.java, that's what I'm trying to explain :)

CleverTap Support

unread,
Mar 26, 2016, 5:14:54 PM3/26/16
to CleverTap Support
Constants class is marked private and not visible. Hence given you the constant 1277182231. Hope it helped.

are events showing up now? or still unsolved ? 

abhila...@gmail.com

unread,
Mar 26, 2016, 11:46:28 PM3/26/16
to CleverTap Support
It's still unresolved. I did use the integer as well.

CleverTap Support

unread,
Mar 28, 2016, 12:28:05 AM3/28/16
to CleverTap Support
Abhilash,

Were you able to set the debug? can you please send us the debug logs incase you were.

Can you also please send us the manifest file?


Reply all
Reply to author
Forward
0 new messages