Class JusttrackSdkBuilder
Initialize your instance of the justtrack SDK by using the JusttrackSdkBuilder. You have to initialize the justtrack SDK before you can use any of its features.
Constructors
Constructor
new JusttrackSdkBuilder(apiToken: string): JusttrackSdkBuilder
Initialize a new builder.
Parameters
Name | Type | Description |
---|---|---|
apiToken | string | The API token provided for your client. |
Returns
JusttrackSdkBuilder
Methods
initialize
initialize(): Promise<void>
Initialize the justtrack SDK. This must be called before any other function.
Returns
Promise<void>
withAutomaticInAppPurchaseTracking
withAutomaticInAppPurchaseTracking(enabled: boolean): JusttrackSdkBuilder
Allows you to control whether the justtrack SDK automatically forwards in-app purchases. Default: yes
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | boolean for enabling. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withEnableFirebaseIntegration
withEnableFirebaseIntegration(enabled: boolean): JusttrackSdkBuilder
Specify whether we should automatically integrate with the Firebase SDK and send the Firebase app instance id of the user to the justtrack backend. Default: yes
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | boolean for enabling. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withInactivityTimeFrameHours
withInactivityTimeFrameHours(
inactivityTimeFrameHours: number,
): JusttrackSdkBuilder
Set the time in hours between app opens in which we try to attribute the user again. Default: 48h
An inactive user did not open the app for this time frame and will check for a new attribution on the next app open. Thus, by default a user is inactive if they don't open the app at least every other day.
Parameters
Name | Type | Description |
---|---|---|
inactivityTimeFrameHours | number | After how many hours will a user be inactive. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withManualStart
withManualStart(isManual: boolean): JusttrackSdkBuilder
Dictates the nature of the start method call. If set to true then the start method will have to be called by app developers after justtrack SDK initialization. If set to false, which is the default value, then the start method will be automatically called by justtrack SDK after initialization.
Parameters
Name | Type | Description |
---|---|---|
isManual | boolean | whether the sdk should start manually or not |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withReAttributionTimeFrameDays
withReAttributionTimeFrameDays(
reAttributionTimeFrameDays: number,
): JusttrackSdkBuilder
Set the time in days between attributions after which we fetch a new up-to-date attribution. Default: 14 days
A user eligible for re-attribution will fetch an attribution on the next app open. Thus, every active user will by default check every two weeks for a new attribution.
Parameters
Name | Type | Description |
---|---|---|
reAttributionTimeFrameDays | number | After how many days will a user be eligible for re-attribution. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withReFetchReAttributionDelaySeconds
withReFetchReAttributionDelaySeconds(
reFetchReAttributionDelaySeconds: number,
): JusttrackSdkBuilder
Set the time in seconds between attribution requests if a retargeting opportunity is detected. Default: 5 seconds
Set to a negative number to deactivate fetching the attribution again.
Parameters
Name | Type | Description |
---|---|---|
reFetchReAttributionDelaySeconds | number | The number of seconds until the attribution is fetched a second time. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withTrackingId
withTrackingId(
trackingId: null | string,
trackingProvider: string,
): JusttrackSdkBuilder
Set the tracking id the SDK will send to the backend.
The tracking id and provider must be shorter than 4096 characters and consist only of printable ASCII characters (U+0020 to U+007E).
Parameters
Name | Type | Description |
---|---|---|
trackingId | null | string | The tracking id the SDK will send to the backend. |
trackingProvider | string | The tracking provider which supplied the trackingId |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.
withUserId
withUserId(userId: string): JusttrackSdkBuilder
Forward a user id to the justtrack backend upon SDK init.
The user id must be shorter than 4096 characters and consist only of printable ASCII characters (U+0020 to U+007E).
Parameters
Name | Type | Description |
---|---|---|
userId | string | The user id to forward. |
Returns
JusttrackSdkBuilder
The builder so you can chain methods if you want.