Creating the Offer

Put the license specifics together to create a compelling offer for your users.

With your Pointer Record, Terms, Uses, and Tags defined, you're ready to present your users with an offer. Licenses offer two additional, optional properties you can leverage —description and expiration.

Description

You can include an optional human-readable description for the license. This is helpful in debugging and building, serving as a reminder of why you created the license in the first place.

TikiSdk.config()
  .offer
  	.description('Look! a data license.')
try? TikiSdk.config()
		.offer
			.description("Look! a data license.")
TikiSdk
		.offer
			.description("Look! a data license.")
await TikiSdk.config()
  	.offer
  		.description("Look! a data license.")

Expiration

You may elect to include an optional expiration date (expiry) for the license. Keep in mind new licenses for the same Title record always supersede previous licenses. When using our config builder, set a duration in seconds which auto-calculates the expiry date on creation for each record.

TikiSdk.config()
  .offer
  	.duration(90 * 24 * 60 * 60) //90 days
try? TikiSdk.config()
		.offer
			.duration(90 * 24 * 60 * 60) //90 days
TikiSdk
		.offer
			.duration(90, TimeUnit.DAYS) //90 days
await TikiSdk.config()
  	.offer
  		.duration(const Duration(days: 90)) //90 days

Example

Let's say you want to increase IDFA opt-in rates by offering users a 10% discount on their next purchase. In exchange, you plan to use the mobile advertising ID for ad attribution and retargeting for the next year.

Offer:

userId = ptr = "eb5c075d-1ccf-4aed-bfa7-76c81c3d162a"
currentTime = 2023-02-27T20:37:44Z

window.TikiSdk.config()
  .offer
    .ptr('eb5c075d-1ccf-4aed-bfa7-76c81c3d162a')
  	.description('Trade your IDFA (kind of like a serial # for your phone) for a 10% discount')
  	.terms('./terms.md')
    .tag(TikiSdk.TitleTag.deviceId())
    .use({ 
  		usecases:[
        TikiSdk.LicenseUsecase.attribution(),
        TikiSdk.LicenseUsecase.retargeting()
      ],
  		destinations:[
        '^https?:\/\/(w{3}\.)?your-co\.com$',
        '\.your-co\.com'
      ]
	})
    .duration( 365 * 24 * 60 * 60)
    .add()
  .initialize('YOUR PUBLISHING ID', 'eb5c075d-1ccf-4aed-bfa7-76c81c3d162a');
try? TikiSdk.config()
    .offer
      .ptr("eb5c075d-1ccf-4aed-bfa7-76c81c3d162a")
      .description("Trade your IDFA (kind of like a serial # for your phone) for a 10% discount")
      .terms('terms.md')
      .tag(.deviceId)
      .use(
        usecases: [
          LicenseUsecase.attribution,
          LicenseUsecase.retargeting
        ], 
        destinations: [
          '^https?:\/\/(w{3}\.)?your-co\.com$',
          "\.your-co\.com"
        ]
      )
      .duration(365 * 24 * 60 * 60)
      .add()
    .initialize( publishingId: "YOUR PUBLISHING ID", id: "eb5c075d-1ccf-4aed-bfa7-76c81c3d162a")
TikiSdk
  .offer
    .ptr("eb5c075d-1ccf-4aed-bfa7-76c81c3d162a")
  	.description("Trade your IDFA (kind of like a serial # for your phone) for a 10% discount")
  	.terms(this, "terms.md")
    .tag(TitleTag.DEVICE_ID)
    .use(
      listOf(
        LicenseUsecase.ATTRIBUTION,
        TikiSdk.RETARGETING
      ),
      listOf(
        "^https?:\/\/(w{3}\.)?your-co\.com$",
        "\.your-co\.com"
      )
    )
    .duration( 365, TimeUnit.DAYS )
    .add()
  .initialize("YOUR PUBLISHING ID", "eb5c075d-1ccf-4aed-bfa7-76c81c3d162a");
await TikiSdk.config()
  	.offer
    	.ptr("93c3e608-322f-4969-9ffd-b4c2329ab0b")
  		.description("Trade your IDFA (kind of like a serial # for your phone) for a 10% discount")
  		.terms("terms.md")
  		.tag(TitleTag.deviceId())
  		.use(
  			[
          	  LicenseUsecase.attribution(),
          	  LicenseUsecase.retargeting()
        	],
            destinations: [
              "^https?:\/\/(w{3}\.)?your-co\.com$",
              "\.your-co\.com"
            ])
  		.duration(const Duration(days: 90))
  		.add()
  	.initialize("YOUR PUBLISHING ID", "eb5c075d-1ccf-4aed-bfa7-76c81c3d162a")

Which the SDK would turn into the following:

Title Record:

{
  "ptr": "eb5c075d-1ccf-4aed-bfa7-76c81c3d162a",
  "tags": ["device_id"],
  "timestamp": "2023-02-27T20:37:44Z",
  "origin": "com.your_co.app"
}

License Record:

{
  "title": "8d7bcc45aad1168b03858e4adf21c303ce2e526eec05ba246a4222042fb6b21f",
  "description": "Trade your IDFA (kind of like a serial # for your phone) for a 10% discount",
  "terms": "THE CONTENTS OF terms.md",
  "uses": [
    {
      "usecases": ["attribution","retargeting"],
      "destinations": ["^https?:\/\/(w{3}\.)?your-co\.com$","\.your-co\.com"],
    }
  ],
  "expiry": "2024-02-27T20:37:44Z",
  "timestamp": "2023-02-27T20:37:44Z"
}

What’s Next