Skip to content

BUG: Unable to get correct values for 'attTrackingStatus', 'adTrackingEnabled' and 'advertisingId' for iOS #212

Open
@stuti7

Description

@stuti7

Hello,
We are using Rudderstack packages rudder_sdk_flutter: ^3.1.0 and rudder_sdk_flutter_platform_interface: ^3.1.0 with our Flutter codebase v3.32.0.

We initialise like below:

final RudderController _client = RudderController.instance;
final builder = RudderConfigBuilder()
      ..withDataPlaneUrl('https://abc.xyz.com’,)
      ..withMobileConfig(MobileConfig(autoCollectAdvertId: true))
      ..withLogLevel(RudderLogger.VERBOSE);

_client.initialize(_writeKey, config: builder.build());

Firstly, while tracking for iOS devices using AppTrackingTransparency popup, on Rudderstack we see attTrackingStatus property, but it is always set to 0. Even when we choose "Allow" tracking, it shows 0.
AppTrackingTransparency.trackingAuthorizationStatus in our codebase returns correct value, but Rudderstack doesn't.
How to make attTrackingStatus accept value according to what we select?


Secondly, if user authorizes the app to track, we want to send advertisingId to Rudderstack. For this we are using putAdvertisingId

 final adid = await AppTrackingTransparency.getAdvertisingIdentifier();
 _client.putAdvertisingId(adid);

After adding this code, when we select "Allow tracking" from the AppTrackingTransparency popup, two new properties appear, called adTrackingEnabled: true and
advertisingId: 00AB4A5D-E0C3-4EEA-8A17-634DDB6F5662.

Now when we go to our device's app settings and disable tracking,
AppTrackingTransparency.getAdvertisingIdentifier() correctly shows 00000000-0000-0000-0000-000000000000 and
AppTrackingTransparency.trackingAuthorizationStatus correctly shows tracking denied.

But Rudderstack continues to show
adTrackingEnabled: true and
advertisingId: 00AB4A5D-E0C3-4EEA-8A17-634DDB6F5662


So there are 2 questions:

  1. How do we set the value of attTrackingStatus in Rudderstack from our Flutter codebase?
  2. How to allow adTrackingEnabled and advertisingId to correctly update their value if we have disallowed tracking?

Below is what we see on Rudderstack:

{
    "anonymousId": "anonymous-id-123",
    "channel": "mobile",
    "context": {
        "app": {
            "build": “1.2.0”,
            "name": “demo_temp”,
            "namespace": "demo.temp.env”,
            "version": “1.2.0”
        },
        "device": {
            "adTrackingEnabled": true,
            "advertisingId": "00AB4A5D-E0C3-4EEA-8A17-634DDB6F5662",
            "attTrackingStatus": 0,
            "id": “……..”,
            "manufacturer": "Apple",
            "model": "iPhone15,4",
            "name": "iPhone",
            "type": "iOS"
        },
        "library": {
            "name": "rudder-ios-library",
            "version": "1.31.1"
        },
        "locale": "en-DE",
        "network": {
            "cellular": false,
            "wifi": true
        },
        "os": {
            "name": "iOS",
            "version": "17.0.3"
        },
        "screen": {
            "density": 3,
            "height": 852,
            "width": 393
        },
        "sessionId": 9876543210,
        "timezone": “…”,
        "traits": {
            "anonymousId": "anonymous-id-123"
        }
    },
    "event": "InApp Page Navigation",
    "integrations": {
        "All": true
    },
    "messageId": “….”,
    "originalTimestamp": "2025-05-30T09:55:00.801Z",
    "properties": {
        "current_route": "/login/",
        "previous_route": "/welcome"
    },
    "receivedAt": "2025-05-30T09:55:01.44143021Z",
    "request_ip": “……”,
    "rudderId": "..........",
    "sentAt": "2025-05-30T09:55:01.385Z",
    "type": "track"
}

We are implementing it for the first time, not sure when the issue started appearing. This is an issue from iOS.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions