Skip to content

Conversation

@nickolas-dimitrakas
Copy link
Contributor

@nickolas-dimitrakas nickolas-dimitrakas commented Dec 11, 2025

Background

  • Rokt requires device identifiers (IDFA) for cross-app attribution tracking in ad placements
  • Previously, only user attributes were passed to Rokt placements, missing device-level identifiers

What Has Changed

  • Added IDFA and IDFV to Rokt placement attributes: Automatically includes IDFA and IDFV from user identities when calling selectPlacements
  • Replaced magic strings with constants: Created kMPRoktAttributeKeyIDFA, kMPRoktAttributeKeyIDFV, kMPRoktAttributeKeySandbox, and internal config key constants for maintainability
  • Added comprehensive method documentation: Documented all public and private methods in MPRokt.m
  • Updated tests: Modified existing tests (testSelectPlacementsSimpleWithValidParameters, testSelectPlacementsExpandedWithValidParameters, testSelectPlacementsSimpleWithMapping) to verify IDFA and IDFV is correctly added when available

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Reference Issue (For employees only. Ignore if you are an outside contributor)

  • Closes NO JIRA

Copy link
Collaborator

@jamesnrokt jamesnrokt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great refactor with a few minor comments

NSString *idfa = resolvedUser.identities[@(MPIdentityIOSAdvertiserId)];
if (idfa.length > 0) {
mappedAttributes[kMPRoktAttributeKeyIDFA] = idfa;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is currently a bug in the rokt-kit that will add the attributes only from the user object. I think @BrandonStalnaker is going to address it soon.

@BrandonStalnaker
Copy link
Collaborator

BrandonStalnaker commented Dec 11, 2025

This functionality may already exist in the sdk, though it's possible its not using the key Sam wants or that it has a bug. I'm going to test through and confirm the functionality asap.
mparticle-integrations/mparticle-apple-integration-rokt#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants