Getting started with Android SDK
Convertedin SDK for events and push notifications is a powerful tool for developers to create engaging and personalized experiences for your app users. With this SDK, developers can easily track user behavior and send targeted push notifications to drive engagement and increase retention. Push notifications allow developers to reach users even when they're not actively using the app, keeping them up to date with the latest news, updates, and promotions. By leveraging Convertedin SDK for events and push notifications, developers can create more meaningful and impactful experiences for their users, leading to higher engagement, increased user satisfaction, and ultimately, greater success for their app.
SDK Integration
The Android SDK is compatible with apps supporting Android API level 21 and above. Apps can be written using Kotlin or Java.
Using Github Library
Downloading and importing the SDK
Adding the dependency to your Gradle files.
Adding dependency to your Gradle files.
Once you acquire a username and password from Convertedin, you can access the repository that has the SDK. Add the following snippet to your root build.gradle
file and you will be able to resolve the library.
Then, in the build.gradle
file for the project for which you would like to include the SDK, add:
Manual Download
Step 1: Downloading and importing the SDK.
Download the SDK from Github and follow the steps
Open your Android Studio project.
Click on the "File" menu and select "New" > "Import Module".
In the "Import Module" dialog box, Browse and select the module file you want to import, then click "Finish".
In the "Project" view, you should now see the imported module as a sub-project within your main project.
Step 2: Adding the dependency to your Gradle files.
Getting Started
Step 1: Initialize the SDK with your Pixel Id and store url.
Initialize the SDK using this function
Step 2: Authenticate user by Sending user data.
The "Identify User" API in the Convertedin SDK allows developers to track and identify users across different devices and sessions. When a user logs in or creates an account, the developer can use the Identify User API to associate a unique identifier with that user.
This identifier can then be used to track the user's actions and behavior throughout their usage of the application. For example, if a user makes a purchase or completes a form, the Identify User API can associate that action with the user's unique identifier.
By using the Identify User API, developers can gain valuable insights into their user's behavior, preferences, and interests. This information can then be used to improve the user experience, personalize content, and increase user engagement and retention.
Additionally, the Identify User API can also be used to implement security measures such as authentication and authorization, by verifying that a user is who they claim to be and granting them access to certain features or content.
Overall, the Identify User API is a powerful tool for developers to understand and optimize their user's experience, as well as provide a more secure and personalized platform for their users.
Identify user using this function
You can enter either email or phone number and country code.
This function is typically triggered when a user signs up for an account or registers their information. By tracking Register events, developers can gain insights into user acquisition and onboarding processes and optimize their registration flow accordingly.
This function is typically triggered when a user login into your app. By tracking login action, developers can gain insights into user acquisition and onboarding processes and optimize their login flow accordingly.
This function is commonly used to set the current customer data, for example email or phone and should be used in the first screen of the app.
Step 3: Track user events and actions through your app.
Tracking user events and actions through your app is an essential component of app development and user analysis. By monitoring user actions and events, developers can gain valuable insights into how users interact with their app, what features they use most often, and where they encounter problems or difficulties.
To track user events and actions through your app, you can Convertedin SDK. it will allow you to track user behavior in real-time and provide detailed reports and analytics on user engagement, retention, and conversion.
Typically, the process of tracking user events and actions involves the following steps:
Define the events you want to track: Before you can start tracking user events, you need to identify the specific actions or behaviors that you want to monitor. For example, you might want to track when a user completes a registration form or makes a purchase.
Instrument your app with tracking code: Once you have identified the events you want to track, you need to add tracking code to your app to collect data on user behavior. This code can be added to specific screens or features of your app to track when users perform certain actions.
Send data to our SDK: Once the tracking code is implemented, the data on user events and actions is sent to us, where it is stored and analyzed. From there, you can generate reports and dashboards to visualize user behavior and identify areas for improvement.
By tracking user events and actions, developers can make data-driven decisions and improve the user experience of their app. Whether you're looking to optimize conversion rates, improve user engagement, or identify areas for improvement, event tracking can provide valuable insights into how users interact with your app.
To add event, you can use this function
There are several predefined events you can use
The ViewContent event is a type of event that is commonly tracked to monitor user behavior on your app. This event is typically triggered when a user views a specific piece of content, such as a product, article, or video. By tracking ViewContent events, developers can gain insights into what content users are engaging with most and optimize their content strategy accordingly. The ViewContent event is one of many events that can be tracked by event tracking platforms, and is an important component of user analysis and app optimization.
The PageView event is a type of event that is commonly tracked to monitor user behavior on your app. This event is triggered when a user views a page or screen within the app. By tracking PageView events, developers can gain insights into how users navigate through their app and optimize the user experience accordingly. The PageView event is one of the most basic and commonly tracked events in event tracking, and is an important component of user analysis and app optimization.
The AddToCart event is a type of event that is commonly tracked to monitor user behavior on an e-commerce app. This event is triggered when a user adds a product to their shopping cart. By tracking AddToCart events, developers can gain insights into which products are most popular and optimize their product offering and pricing accordingly. The AddToCart event is often paired with other e-commerce events such as Purchase or Checkout events, and is an important component of user analysis and e-commerce optimization.
The InitiateCheckout event is a type of event that is commonly tracked to monitor user behavior during the checkout process on an e-commerce app. This event is triggered when a user begins the process of checking out and entering their payment and shipping information. By tracking InitiateCheckout events, developers can gain insights into how users interact with the checkout process and identify areas for improvement to increase conversion rates. The InitiateCheckout event is often paired with other e-commerce events such as AddToCart or Purchase events, and is an important component of user analysis and e-commerce optimization.
The Purchase event is a type of event that is commonly tracked to monitor user behavior on an e-commerce app. This event is triggered when a user completes a purchase and successfully makes a payment for a product or service. By tracking Purchase events, developers can gain insights into which products are most popular and identify patterns in user behavior to optimize the checkout process and increase sales. The Purchase event is often paired with other e-commerce events such as AddToCart or InitiateCheckout events, and is an important component of user analysis and e-commerce optimization.
Step 4: Configre Push Notifications.
To use Convertedin SDK’s push notifications, you need to integrate with Firebase notifications
Integrating your Android app with Firebase Notifications allows you to send push notifications to your app users. Here are the steps to integrate your Android app to Firebase Notifications:
Create a Firebase project: If you haven't already, create a Firebase project in the Firebase console and add your Android app to it.
Add the Firebase SDK to your app: Add the Firebase SDK to your app by following the instructions provided by Firebase. This involves adding the necessary dependencies to your app's Gradle files and downloading a google-services.json file from the Firebase console and adding it to your app.
Set up Firebase Cloud Messaging: Firebase Cloud Messaging (FCM) is the service that powers Firebase Notifications. Follow the instructions provided by Firebase to set up FCM for your Android app.
Add Firebase messaging to your app: To receive Firebase Notifications in your app, you need to add Firebase Messaging to your app. This involves creating a FirebaseMessagingService and registering it in your app's AndroidManifest.xml file.
Handle incoming messages: Once you have set up Firebase Messaging in your app, you can receive incoming messages in your FirebaseMessagingService. You can then handle the message data and display a notification to the user.
Test your integration: Finally, test your Firebase Notifications integration by sending a test notification from the Firebase console or using a third-party tool like Postman.
By following these steps, you can integrate your Android app with Firebase Notifications and start sending push notifications to your app users.
Step 5: Save Device Token
After Integrating with firebase successfully, call this function on the SDK to send the firebase token to start getting notifications from your dashboard.
⚠️ Important Note: Each Time firebase token is updated you must call saveDeviceToken function to save the new firebase token
Step 6: Pass Campaign ID
This event is typically triggered when a user clicks on a push notification, and should pass the received campaign id to the function onPushNotificationClicked()
, and you can find the campaign id in the payload of the push notification ["campaign_id"] with a string value.
Logging out
If user logged out or you want user to stop getting notifications from our side, you can call this function
proguard-rules
Last updated