Session parameters

You can create session parameters to send data back with tracked objects. Session parameters are key-value pairs that the SDK attaches to payloads. Once you have added parameters the SDK saves them for re-use elsewhere. This means if you add the same parameter twice it has no effect on the parameter value.

The SDK sends session parameters back with each of the following:

Sometimes you can only set session parameters after your app has launched. If this is the case, you can delay the first launch of the Adjust SDK. This gives you time to set the parameters and enable the Adjust SDK to send them with the install event.

Session callback parameters

You can send callback parameters with each session of the Adjust SDK. You can set up session callback parameters by calling the addSessionCallbackParameter method:

Objective-C
Swift
Javascript
[Adjust addSessionCallbackParameter:@"foo" value:@"bar"];

The Adjust SDK will merge session callback parameters with event callback parameters. Event callback parameters take priority over session callback parameters. This means that if you add a parameter key to both an event and a session, the SDK will send the event parameter.

You can remove specific session callback parameters if they are no longer required. To do this, call the removeSessionCallbackParameter method with the parameter key.

Objective-C
Swift
Javascript
[Adjust removeSessionCallbackParameter:@"foo"];

You can remove all session parameters if they are no longer required. To do this, call the resetSessionCallbackParameters method.

Objective-C
Swift
Javascript
[Adjust resetSessionCallbackParameters];

Session partner parameters

The Adjust SDK also enables you to send callback parameters to network partners. You will need to set up your network partners in the Adjust dashboard to use this feature.

You can set up session partner parameters by calling the addSessionPartnerParameter method:

Objective-C
Swift
Javascript
[Adjust addSessionPartnerParameter:@"foo" value:@"bar"];

The Adjust SDK will merge session partner parameters with event partner parameters. Event partner parameters take priority over session partner parameters. This means that if you add a partner parameter key to both an event and a session, the SDK will send the event parameter.

You can remove specific session callback parameters if they are no longer required. To do this, call the removeSessionPartnerParameter method with the parameter key.

Objective-C
Swift
Javascript
[Adjust removeSessionPartnerParameter:@"foo"];

You can remove all session partner parameters if they are no longer required. To do this, call the resetSessionPartnerParameters method.

Objective-C
Swift
Javascript
[Adjust resetSessionPartnerParameters];

Delay start

By default, the Adjust SDK will start as soon as your app opens. If you want to send data that is not available at launch in session parameters, you can delay the start of the SDK. This can be helpful if you are sending information such as unique identifiers.

You can set a delay by passing the delay time in seconds to the delayStart property.

Objective-C
Swift
Javascript
[adjustConfig setDelayStart:5.5];

In the above example, the Adjust SDK will not send the install session or any events for 5.5 seconds. After this time has elapsed, the SDK will send the information to the backend. You can send the information before the timeout by calling the sendFirstPackages method.

Note:
You can delay the startup of the SDK by up to 10 seconds.