Superwall

setIntegrationAttributes

Sets integration attributes for third-party analytics and attribution providers.

This method was introduced in version 4.8.1. It allows you to set attributes for third-party integrations like Amplitude, Mixpanel, and other analytics platforms.

Purpose

Sets integration attributes that are sent to Superwall's servers and can be used for analytics and attribution tracking with third-party providers.

Signature

public func setIntegrationAttributes(_ props: [IntegrationAttribute: String?])

Parameters

ParameterTypeDescription
props[IntegrationAttribute: String?]A dictionary mapping integration attribute keys to their values. Use nil to remove an attribute.

Returns / State

This method returns Void. The attributes are stored and sent to Superwall's servers.

Usage

Set integration attributes:

Superwall.shared.setIntegrationAttributes([
  .amplitudeUserId: "user123",
  .mixpanelDistinctId: "distinct456",
  .custom("myCustomKey"): "customValue"
])

Remove an attribute by setting it to nil:

Superwall.shared.setIntegrationAttributes([
  .amplitudeUserId: nil  // Removes the amplitudeUserId attribute
])

Access current integration attributes:

let attributes = Superwall.shared.integrationAttributes
print("Current attributes: \(attributes)")

IntegrationAttribute Types

Common integration attributes include:

  • .amplitudeUserId - Amplitude user ID
  • .mixpanelDistinctId - Mixpanel distinct ID
  • .custom(String) - Custom attribute key

How is this guide?

Edit on GitHub