Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disableIDFV on tracking options has no effect #107

Closed
alessiolapenna opened this issue Jan 12, 2024 · 1 comment
Closed

disableIDFV on tracking options has no effect #107

alessiolapenna opened this issue Jan 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@alessiolapenna
Copy link

alessiolapenna commented Jan 12, 2024

Trying to dissable IDFV tracking, has no effect, since the Amplitude initializer set its deviceid as the idfv before the tracking options are even checked.
Initializing the sdk like this:

Amplitude(
            configuration: Configuration(
                apiKey: Constants.ExternalSDKs.Amplitude.apiKey(),
                trackingOptions: TrackingOptions()
                    .disableTrackIpAddress()
                    .disableTrackIDFV()
            )
        )

in the Amplitude initializer the ContextPlugin is initialized:

func initializeDeviceId() {
        var deviceId = amplitude?.state.deviceId
        if isValidDeviceId(deviceId) {
            return
        }
        if deviceId == nil {
            deviceId = staticContext["idfv"] as? String
        }
        if deviceId == nil {
            deviceId = NSUUID().uuidString
        }
        _ = amplitude?.setDeviceId(deviceId: deviceId)
    }

this will set the deviceId on the amplitude instance as the idfv.
Then later even if the event.idfv field will not be filled, the device id will still be equal to the idfv.

Expected Behavior

disabling the idfv tracking should also anonymize the deviceid on the amplitude instance

Current Behavior

amplitude instance device id is still equal to the idfv

Possible Solution

When the ConectPlugin is initialized, the tracking options should be passed down, and when the deviceid is initialized a check should be done, and if idfv is disabled, the device id should be set to a random uuid

Steps to Reproduce

  1. init the sdk with this code:
Amplitude(
            configuration: Configuration(
                apiKey: Constants.ExternalSDKs.Amplitude.apiKey(),
                trackingOptions: TrackingOptions()
                    .disableTrackIpAddress()
                    .disableTrackIDFV()
            )
        )
  1. track any event
  2. the event.deviceid is equal to idfv

Environment

  • SDK Version: 1.1.0
  • OS Info: any iOS
@alessiolapenna alessiolapenna added the bug Something isn't working label Jan 12, 2024
@crleona
Copy link
Collaborator

crleona commented Mar 15, 2024

Hi @alessiolapenna - this should be fixed in the latest release.

@crleona crleona closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants