Integrating Adjust with Countly

This guide walks you through the process of integrating Adjust with Countly, covering setup steps across Adjust, your app, and the Countly server.

Integration on the Adjust side

Within the Adjust dashboard, you can enable additional modules for each app. One of these modules is Countly. Please follow Adjust’s official guide for setting up the Countly module here.

To configure the module, you will need to provide the Countly App Key and Server URL.

Integration on the App/SDK side

When integrating Countly SDK into your app, you will need to:

  1. Get the Adjust ID from the Adjust SDK
  2. Pass it to the Countly SDK as a custom user property with key adjust_id.

Here are some examples for various SDKs:
 

Web Android iOS Flutter React Native Windows Unity
Adjust.getAdid((adjust_id) = {
  if (adjustId) {
    Countly.q.push(['userData.set', "adjust_id", adjust_id])
    Countly.q.push(['userData.save'])
  }
});

Integration on the Countly Server

On the server side, make sure that the Adjust plugin is enabled in your Countly instance.

How It Works

Basic Flow

  1. Adjust campaign links are used in your ads.
  2. User clicks the ad -> Adjust tracks the click.
  3. User installs and launches the app.
  4. Adjust SDK initializes, registers the install, and sends it to the Adjust servers.
  5. Countly SDK retrieves the Adjust ID and sends it to the Countly server as a custom property.
  6. Adjust server sends the campaign data to Countly server. 
  7. Countly server matches campaign data with the user using the adjust_id property.  

Matching and Attribution Logic

Incoming adjust data is stored in the countly.adjust collection. It looks something like this:

{
 "_id": "ObjectId(66e2ba9f489ca1f8548bcc79)",
 "event": "install",
 "tracker_name": "{tracker_name}",
 "last_tracker_name": "{last_tracker_name}",
 "first_tracker_name": "{first_tracker_name}",
 "outdated_tracker_name": "{outdated_tracker_name}",
 "adgroup_name": "{adgroup_name}",
 "network_name": "{network_name}",
 "campaign_name": "{campaign_name}",
 "creative_name": "{creative_name}",
 "installed_at": "{installed_at}",
 "click_time": "{click_time}",
 "adjust_id": "{adid}",
 "app_id": "5ab0c3ef92938d0e61cf77f4",
 "cd": {
   "$date": "2024-09-12T09:55:43.021Z"
 }
}

When a user's session includes the adjust_id custom property, Countly checks the countly.adjust collection for matching data.

If we match a user with the adjust data received, then: 

  • We take all placeholders and put them as custom user properties
  • We check if the property does not exist, then we prefix it with first_  to preserve the user's first-ever campaign data.

If no match is found immediately (e.g., due to a delay in Adjust data), Countly will attempt matching again at the end of the next user session. 

Additionally, an event is created prefixed with adjust_. For example: 

If we receive "install", we create the event "adjust_install" with all campaign properties as event segments.

The result looks something like this:

"custom": {
   "adjust_id": "test_id",
   "adgroup_name": "{adgroup_name}",
   "campaign_name": "{campaign_name}",
   "click_time": "{click_time}",
   "creative_name": "{creative_name}",
   "first_adgroup_name": "{adgroup_name}",
   "first_campaign_name": "{campaign_name}",
   "first_click_time": "{click_time}",
   "first_creative_name": "{creative_name}",
   "first_first_tracker_name": "{first_tracker_name}",
   "first_installed_at": "{installed_at}",
   "first_last_tracker_name": "{last_tracker_name}",
   "first_network_name": "{network_name}",
   "first_outdated_tracker_name": "{outdated_tracker_name}",
   "first_tracker_name": "{first_tracker_name}",
   "installed_at": "{installed_at}",
   "last_tracker_name": "{last_tracker_name}",
   "network_name": "{network_name}",
   "outdated_tracker_name": "{outdated_tracker_name}",
   "tracker_name": "anothertracker"
  },

Supported Placeholders and Events

Adjust provides a variety of events and placeholders that can be passed to Countly. See full list here:
https://help.adjust.com/en/partner/placeholders

The parameters and events we track are configured within the Countly module on Adjust's side, and cannot be customized per app by the end user. For changes, Adjust must be contacted directly. 

Sample Tracking Link Format

When generating Adjust links for campaigns, we include: 

  • Event
  • App Key
  • adjust_id
  • All required placeholders by keys

For example:

/i/adjust?app_key={app_key}&event=install&adgroup_name={adgroup_name}&campaign_name={campaign_name}&click_time={click_time}&adjust_id={adid}

This would be converted into custom properties:

"custom": {
"adjust_id": "test_id",
"adgroup_name": "{adgroup_name}",
"campaign_name": "{campaign_name}",
"click_time": "{click_time}",
"first_adgroup_name": "{adgroup_name}",
"first_campaign_name": "{campaign_name}",
"first_click_time": "{click_time}",
}

And event:

{
   "key": "adjust_install",
   "count": 1,
   "segmentation": {    
       "adjust_id": "test_id",
       "adgroup_name": "{adgroup_name}",
       "campaign_name": "{campaign_name}",
       "click_time": "{click_time}",
   }
},

 

 

 

Was this page helpful?
Reach out to us for any other questions.
Helpful?

Looking for more Help?