From 450c2a1d197c4777adddc6f3bd93fdd8997c55d2 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 3 Aug 2022 16:03:08 +0100 Subject: [PATCH 1/4] Add alias method --- .../catalog/libraries/mobile/swift-ios/index.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md index bab69e88a6..d82ed41ef7 100644 --- a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md +++ b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md @@ -186,6 +186,23 @@ analytics.group(groupId: "user-123", traits: MyTraits( {% endcodeexampletab %} {% endcodeexample %} +### Alias +The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced method, but can be used to manage user identities successfully in some of our destinations. +When this method is called the `newId` value will overwrite the old userId. If no userId is currently set, the `newId` will be associated with future events as the userId. This is an advanced method and may not be supported across our destination catalog, please refer to our destination docs to understand if this method is supported or not. + +{% codeexample %} +{% codeexampletab Method signature %} +```swift +func alias(newId: String) +``` +{% endcodeexampletab %} + +{% codeexampletab Example use %} +```swift +analytics.alias(newId: "user-123") +``` +{% endcodeexampletab %} +{% endcodeexample %} ## Plugin Architecture Segment's plugin architecture enables you to modify and augment how the analytics client works. From modifying event payloads to changing analytics functionality, plugins help to speed up the process of getting things done. From 7b680a2a374d8f9a7a9696faa20e46be56a357fb Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 3 Aug 2022 16:06:46 +0100 Subject: [PATCH 2/4] Add alias method --- .../sources/catalog/libraries/mobile/swift-ios/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md index d82ed41ef7..d25244d624 100644 --- a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md +++ b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md @@ -187,8 +187,7 @@ analytics.group(groupId: "user-123", traits: MyTraits( {% endcodeexample %} ### Alias -The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced method, but can be used to manage user identities successfully in some of our destinations. -When this method is called the `newId` value will overwrite the old userId. If no userId is currently set, the `newId` will be associated with future events as the userId. This is an advanced method and may not be supported across our destination catalog, please refer to our destination docs to understand if this method is supported or not. +The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. When this method is called the `newId` value will overwrite the old userId. If no userId is currently set, the `newId` will be associated with future events as the userId. This is an advanced method and may not be supported across the entire destination catalog, please refer to the destination docs to understand if this method is supported or not. {% codeexample %} {% codeexampletab Method signature %} From 6f1ce5891ea75c9a1089adbe6d16d0478cdebfb2 Mon Sep 17 00:00:00 2001 From: stayseesong <83784848+stayseesong@users.noreply.github.com> Date: Wed, 3 Aug 2022 09:33:51 -0700 Subject: [PATCH 3/4] Update src/connections/sources/catalog/libraries/mobile/swift-ios/index.md --- .../sources/catalog/libraries/mobile/swift-ios/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md index d25244d624..6c5a10a1ea 100644 --- a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md +++ b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md @@ -187,7 +187,7 @@ analytics.group(groupId: "user-123", traits: MyTraits( {% endcodeexample %} ### Alias -The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. When this method is called the `newId` value will overwrite the old userId. If no userId is currently set, the `newId` will be associated with future events as the userId. This is an advanced method and may not be supported across the entire destination catalog, please refer to the destination docs to understand if this method is supported or not. +The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. When this method is called, the `newId` value overwrites the old `userId`. If no `userId` is currently set, the `newId` associates with future events as the `userId`. This is an advanced method and may not be supported across the entire destination catalog. {% codeexample %} {% codeexampletab Method signature %} From 7d81a4cd061f341a99d5309b1e4507789dbbfc2c Mon Sep 17 00:00:00 2001 From: stayseesong Date: Wed, 3 Aug 2022 09:46:27 -0700 Subject: [PATCH 4/4] fixes --- .../sources/catalog/libraries/mobile/swift-ios/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md index 6c5a10a1ea..430775a8ea 100644 --- a/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md +++ b/src/connections/sources/catalog/libraries/mobile/swift-ios/index.md @@ -34,7 +34,7 @@ To get started with the Analytics-Swift mobile library: ```swift var analytics: Analytics? = nil - + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let configuration = Configuration(writeKey: "WRITE_KEY") @@ -68,6 +68,7 @@ Once you've installed the Analytics-Swift library, you can start collecting data - [Track](#track) - [Screen](#screen) - [Group](#group) +- [Alias](#alias) ### Identify The [Identify](/docs/connections/spec/identify/) method lets you tie a user to their actions and record traits about them. This includes a unique user ID and any optional traits you know about them like their email, name, address. The traits option can include any information you want to tie to the user. When using any of the reserved traits, be sure the information reflects the name of the trait. For example, `email` should always be a string of the user's email address. @@ -187,7 +188,7 @@ analytics.group(groupId: "user-123", traits: MyTraits( {% endcodeexample %} ### Alias -The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. When this method is called, the `newId` value overwrites the old `userId`. If no `userId` is currently set, the `newId` associates with future events as the `userId`. This is an advanced method and may not be supported across the entire destination catalog. +The [Alias](/docs/connections/spec/alias/) method is used to merge two user identities, effectively connecting two sets of user data as one. When this method is called, the `newId` value overwrites the old `userId`. If no `userId` is currently set, the `newId` associates with future events as the `userId`. This is an advanced method and may not be supported across the entire destination catalog. {% codeexample %} {% codeexampletab Method signature %} @@ -202,6 +203,7 @@ analytics.alias(newId: "user-123") ``` {% endcodeexampletab %} {% endcodeexample %} + ## Plugin Architecture Segment's plugin architecture enables you to modify and augment how the analytics client works. From modifying event payloads to changing analytics functionality, plugins help to speed up the process of getting things done.