Troubleshooting

This guide will help you troubleshoot the most common issues that you may face during SDK integration.

User Tracking

1. User data not reflecting in the timeline / unified view

Cause 1: Invalid user identity.
If the blank or null identity is passed in the login() or setUserIdentity(), the CEE SDK will consider the user and its activity as anonymous.

Cause 2: Wrong user identity.
Suppose the primary key set on the CEE dashboard is EMAIL and the developer passes MOBILE in the login() or setUserIdentity() method. In this case, the events/activities for that user will be considered invalid and will be dropped by the CEE server. The developer needs to make sure that he/she is passing the same identity as the primary key set on the CEE panel.

2. Profile push data not reflecting in the timeline / unified view

Cause 1: Invalid user identity.
Refer to the above section

Cause 2: Wrong user identity.
Refer to the above section

Cause 3: Attribute missing on the dashboard.
If the attribute passed in the profile push payload is not already created on the dashboard, the attribute value will be ignored from the profile push request on the server.

Event tracking

1. Event data not reflecting on the dashboard / timeline / unified view

Cause 1: Invalid user identity.
Refer to the above section

Cause 2: Wrong user identity.
Refer to the above section

Cause 3: Wrong/Invalid payload.
If the payload does not meet the below points then it is not a valid payload.

  • Keys in the payload should not contain any special characters. Only underscore (_) is accepted.
  • The payload should not contain JSON objects/arrays.
  • If the event does not require any payload/attributes then pass an empty hashmap. If a null payload is passed then the server will discard the event.

Push notifications

1. Push notifications not working

Cause 1: Wrong FCM integration.
CEE uses the power of FCM (Firebase Cloud Messaging SDK) to deliver the PNs to the device. Check if you have implemented the FCM correctly in your project and it is functional.

Cause 2: Method smartech.handlePushNotification() not integrated or not accessible.
The handlePushNotification() method of SDK is responsible for handling the PNs received from CEE. If the method is not implemented in the onMessageReceived() method of FCM service, the PNs will not work. Also, check if the method is accessible every time the notification message is received in onMessageReceived().

Cause 3: TokenNotFoundError / NotRegistered / MismatchSenderId while testing PNs.
3.1 TokenNotFound: This error usually comes due to the unavailability of the FCM token on the server. Due to the requests queue on the CEE server, you may face this issue sometimes. Wait for 10-15 mins and try again. If this is not the case, make sure the FCM token is getting passed to CEE SDK by observing CEE logs in Android Logcat. Here is the link for enabling Smartach debugging logs (https://cedocs.netcorecloud.com/docs/android-customer-engagement-advanced#debugging). Reinstalling the app also works many times.

3.2 NotRegistered: This error comes when the app for the targeted token/identity is uninstalled.

3.3 MismatchSenderId: This error comes when the FCM server key supplied to CEE app assets and google-services.json in the Android application do not match or point to different Firebase projects.

2. Push notification icon not showing

Cause 1: Wrong syntax or No implementation.
Check if you have used the correct syntax for setting the PN icon. In the application class, add the below line for setting the notification icon.

public void onCreate() {
        super.onCreate();

        Smartech smartech = Smartech.getInstance(new WeakReference<>(this));
        smartech.initializeSdk(this);

        // Setting PN icon.
        SMTNotificationOptions options = new SMTNotificationOptions(this);
        options.setSmallIconTransparentId(R.drawable.ic_notification);
        smartech.setNotificationOptions(options);
}

Cause 2: Icon not present in the drawable directory.
The drawable file that you are using for the notification icon must be present inside the res/drawable directory.

Cause 3: Icon not supported.
The icon used for notification must meet the notification icon guidelines given by Android. As per Android, the icon should be white and the background must be transparent. The icon sizes should match the following dimensions.

Screen Size/Type

Size (in Px)

Small Notification Icon (mdpi)

24 x 24

Small Notification Icon (hdpi)

36 x 36

Small Notification Icon (xhdpi)

48 x 48

Small Notification Icon (xxhdpi)

72 x 72

Small Notification Icon (xxxhdpi)

96 x 96

3. Deeplinks not working

Cause 1: Wrong Deeplink integration.
Deeplinks will not work if the deeplink integration is wrong. Make sure you have done the below steps.

  • Creating the BroadcastReceiver class: Create a broadcast receiver and override its onReceiver() method to handle the deeplinks and custom-payload/key-value pairs like given below.
public class SmartechDeepLinkHandler extends BroadcastReceiver {
   public void onReceive(Context context, Intent intent) {
       if (intent != null) {
           Bundle extras = intent.getExtras();

           if (extras != null) {
               if (extras.containsKey(SMTBundleKeys.SMT_BUNDLE_KEY_CLICK_DEEPLINK)) {
                   String deeplink = extras.getString(SMTBundleKeys.SMT_BUNDLE_KEY_CLICK_DEEPLINK);
                   Log.i(TAG, "Deeplink: " + deeplink);
                   // TODO Handle the deeplink.
               }

               if (extras.containsKey(SMTBundleKeys.SMT_BUNDLE_KEY_CLICK_CUSTOM_PAYLOAD)) {
                   String customPayload = extras.getString(SMTBundleKeys.SMT_BUNDLE_KEY_CLICK_CUSTOM_PAYLOAD);
                   Log.i(TAG, "Custom Payload: " + customPayload);
                   // TODO Handle the custom payload.
               }
           }
       }
   }
}
  • Registering the BroadcastReceiver in the Application class: Once the broadcast receiver is created register it in the application class.
public class SampleApplication extends Application {
   @Override
   public void onCreate() {
       super.onCreate();

       Smartech.getInstance(new WeakReference<>(this)).initializeSdk(this);

       // Registering the broadcast receiver.
       SmartechDeepLinkHandler smtDeepLinkHandler = new SmartechDeepLinkHandler();
       IntentFilter filter = new IntentFilter("com.smartech.EVENT_PN_INBOX_CLICK");
       registerReceiver(smtDeepLinkHandler, filter);
   }
}
  • Calling the onReceive() of BroadcastReceiver in the launcher activity: When the app is in the background/terminated state, the deeplink callback goes to the launcher activity. Call receiver’s onReceive() method to handle the deeplink.
new SmartechDeepLinkHandler().onReceive(this, getIntent());

Cause 2: Not handling parameters.
CEE server adds its own query parameter in the deeplink URL for tracking purposes. For example, sample://smartechapp.com/profile?sta_a=XYZ&sta_b=PQR. Make sure these parameters are handled.

4. Blank push notifications or no push notifications

Cause 1: Crash in onMessageReceived() of FCM service.
There are chances of SDK generating a blank PN if there is a crash in the onMessageReceived() method of the FCM service. Make sure there is no crash or exception in the FCM service.

Cause 2: Non-supported payload.
If the handlePushNotification() method receives the non-supported payload it will return false and control will be given to the client’s code. The client’s code might generate the blank PN for that payload. If the notification source is CEE and still handlePushNotification() returns false then the dashboard must not be configured for the SDK3.

In-app messages

1. In-Apps not working

Cause 1: In-App rules not fetched.
In-Apps uses JSON-based rules for its functioning. Once the in-app is published check if you can see JSON rules on URL https://pnrules.netcoresmartech.com/inappactivity/<APP_ID>.json. Also, make sure you see the same logs in the Android Logcat by filtering the logcat with InApp. Check if you can see an entry in the rules for the event on which the in-app is set.

Cause 2: User not present in the list / segment.
If the in-app is targeted to a specific list/segment, hit the following URL and check if the list/segment ID is present in the JSON rule. List and Segments URL: https://psegment.netcoresmartech.com/user_attr?identity=<USER_IDENTITY>&appid=<SMARTECH_APP_ID>

Cause 3: Event name or parameter not matching.
Trigger the event for which the in-app is set and check the event name/payload parameter are matching as per the in-app rules.

Cause 4: Context / Screen changed before in-app.
After the trigger of the event for which in-app is set, the screen changes then the in-app will dismiss quickly or not even show up. Make sure the screen does not change after the in-app trigger event. If the in-app is set on the app launch event and there is a splash screen in the app, there are chances of in-app failure due to the screen change.

2. Deeplinks not working

Cause 1: Wrong deeplink integration / URL.
In-App deeplinks are totally different than the PN deeplinks. Check if you have added the intent-filters for the activity like given below.

<activity
   android:name=".ProfileActivity">
   <intent-filter>
       <action android:name="android.intent.action.VIEW" />

       <category android:name="android.intent.category.DEFAULT" />
       <category android:name="android.intent.category.BROWSABLE" />

       <data
           android:host="smartech.netcore.com/profile"
           android:scheme="https" />
   </intent-filter>
</activity>

The deeplink should be the combination of the scheme and the host. For the above example, the deeplink URL will be https://smartech.netcore.com/profile.


Did this page help you?