Skip to content

Commit 02de632

Browse files
authored
Merge pull request #8013 from elemhunt/develop
Fixes for batch 2.3
2 parents ffa5ef9 + 424f728 commit 02de632

24 files changed

+59
-58
lines changed

src/connections/sources/catalog/libraries/mobile/apple/swift-typewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ To learn more about the `typewriter.yml` configuration format, see the [Configur
223223

224224
As mentioned in the [Best Practices](#best-practices) section above, Segment recommends that you only check in the `plan.json`, and not the generated clients, into your version control. Instead, Segment recommends building these clients as part of the build step for your application.
225225

226-
In your CI environment, this usually involves a step to build the Typewriter client. Make sure to build the production client before deploying the application, as explained in the [Tracking Plan Violation Handling](#tracking-plan-violation-handling) section below.
226+
In your CI environment, this usually involves a step to build the Typewriter client. Make sure to build the production client before deploying the application, as explained in [Tracking Plan Violation Handling](/docs/protocols/apis-and-extensions/typewriter/#tracking-plan-violation-handling).
227227

228228
```yaml
229229
# An example (simplified) CircleCI configuration:

src/connections/sources/catalog/libraries/mobile/kotlin-android/destination-plugins/adobe-kotlin-android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Adobe Analytics uses a slightly different approach to tracking than Segment, and
1212

1313
For example, if one of your end users dismissed a welcome dialog in your app, Segment would generate a `Welcome Dialog Dismissed` event with properties that contain the user ID (`user123`) and the dialog name (`welcome-dialog`), while Adobe Analytics would model the same action as a pageView with variables that represent the dialog name, visitorID, and the event name, and an eVar ("dismissed").
1414

15-
Both Segment and Adobe Analytics have recommended standard data for tracking events. Segment has [the Spec](/docs/connections/spec/), and Adobe uses predefined events. Segment automatically maps incoming event data and some product level properties to Adobe's predefined events, when the event data is in the correct Segment Ecommerce Spec](/docs/connections/spec/ecommerce/v2/) format. Video calls using the format described in this document are also automatically mapped. If you're using the Mobile SDKs, mobile lifecycle events are also automatically mapped. If you need to create Page and Track events that are outside the scope of the Ecommerce Spec, you need to map those in your Segment destinations settings UI.
15+
Both Segment and Adobe Analytics have recommended standard data for tracking events. Segment has [the Spec](/docs/connections/spec/), and Adobe uses predefined events. Segment automatically maps incoming event data and some product level properties to Adobe's predefined events, when the event data is in the correct [Segment Ecommerce Spec](/docs/connections/spec/ecommerce/v2/) format. Video calls using the format described in this document are also automatically mapped. If you're using the Mobile SDKs, mobile lifecycle events are also automatically mapped. If you need to create Page and Track events that are outside the scope of the Ecommerce Spec, you need to map those in your Segment destinations settings UI.
1616

1717
Segment strongly recommends that you create a Tracking Plan for both your Segment and Adobe Analytics events before you send any events or properties to Adobe. This helps you map your Segment events to Adobe `events` and Segment properties to Adobe variables. If you decide to set up Adobe Analytics for mobile, you must set up this mapping in both the Segment settings and the Adobe Mobile Services dashboard, so it's good to stay consistent.
1818

src/connections/sources/catalog/libraries/mobile/kotlin-android/destination-plugins/braze-kotlin-android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...
6363

6464
Your events will now begin to flow to Braze in device mode.
6565

66-
# Identify
66+
## Identify
6767

6868
> info "Tip"
6969
> Add Segment's open-source [Middleware](https://github.com/segmentio/segment-braze-mobile-middleware) tool to optimize your integration. This tool limits [Data Point](https://www.braze.com/docs/user_guide/data_and_analytics/data_points/) use by debouncing duplicate identify() calls from Segment. For more information, see the project's [README](https://github.com/segmentio/segment-braze-mobile-middleware/blob/master/README.md#how-does-this-work).

src/connections/sources/catalog/libraries/mobile/kotlin-android/destination-plugins/mixpanel-kotlin-android.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ strat: kotlin-android
77

88
Segment's Mixpanel destination plugin code is open source and [available on GitHub](https://github.com/segment-integrations/analytics-kotlin-mixpanel){:target="_blank"}.
99

10-
## Getting Started
11-
12-
10+
## Getting started
1311

1412
1. From the Segment app Destinations page click on **Add Destination**.
1513
2. Search for Mixpanel in the Destinations Catalog and confirm the Source to connect to.
@@ -30,11 +28,9 @@ Or the following for Kotlin DSL
3028
implementation('com.segment.analytics.kotlin.destinations:mixpanel:<latest_version>')
3129
```
3230

33-
34-
3531
## Using the Plugin in your App
3632

37-
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.
33+
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.
3834

3935
```
4036
import com.segment.analytics.kotlin.destinations.mixpanel.MixpanelDestination
@@ -67,12 +63,11 @@ analytics.identify("user-123", buildJsonObject {
6763
The first thing you'll want to do is to identify your users so Mixpanel knows who they are. You'll use the Identify method to accomplish this which takes the unique `userId` of a user and any `traits` you know about them.
6864

6965
> info ""
70-
> **Important:** Mixpanel used to require that you call `alias` in all libraries to connect anonymous visitors to identified users. However, with the release of Mixpanel's new [Identity Merge feature](https://help.mixpanel.com/hc/en-us/articles/360039133851#enable-id-merge){:target="_blank"} this is no longer necessary. To enable ID Merge, go to your Mixpanel Settings Dashboard, navigate to **Project Settings > Identity Merge** and enable the setting from that screen. If you are _not_ using this setting, use the instructions below.
71-
66+
> **Important**: Mixpanel used to require that you call `alias` in all libraries to connect anonymous visitors to identified users. However, with the release of Mixpanel's new [Identity Merge feature](https://help.mixpanel.com/hc/en-us/articles/360039133851#enable-id-merge){:target="_blank"} this is no longer necessary. To enable ID Merge, go to your Mixpanel Settings Dashboard, navigate to **Project Settings > Identity Merge** and enable the setting from that screen. If you are \_not_ using this setting, use the instructions below.
7267
7368
As soon as you have a `userId` for a visitor that was previously anonymous you'll need to [`alias`](/docs/connections/spec/alias/) their old anonymous `id` to the new `userId`. In Mixpanel only **one** anonymous user history can be merged to **one** identified user. For that reason you should only call `alias` once, right after a user registered, but before the first `identify`.
7469

75-
When you call the Identify method from the client in either a browser using Analytics.js or one a mobile SDKs, several things occur: Segment recognizes and translates the [special traits](/docs/connections/spec/identify/#traits) so that they fit the expectations of Mixpanel's API. The table below shows the mappings. Pass the key on the left and Segment transforms it to the key on the right before sending to Mixpanel.
70+
When you call the Identify method from the client in either a browser using Analytics.js or one a mobile SDKs, several things occur: Segment recognizes and translates the [special traits](/docs/connections/spec/identify/#traits) so that they fit the expectations of Mixpanel's API. The table below shows the mappings. Pass the key on the left and Segment transforms it to the key on the right before sending to Mixpanel.
7671

7772
<table>
7873
<tr>
@@ -157,6 +152,7 @@ analytics.track("View Product", buildJsonObject {
157152
put("productName" "Striped trousers")
158153
});
159154
```
155+
160156
Because Mixpanel is an event tracking analytics tool, you'll want to [`track`](/docs/connections/spec/track/) your user's actions. The more useful events you [`track`](/docs/connections/spec/track/), the better Mixpanel becomes.
161157

162158
You should use the [`track`](/docs/connections/spec/track/) method to accomplish this. The Segment [`track`](/docs/connections/spec/track/) method maps events and event properties directly to Mixpanel events and event properties.
@@ -171,16 +167,15 @@ There are two strings to avoid when naming event properties that will be sent to
171167

172168
### Explicitly Set People Properties and Super Properties
173169

174-
Previously, Segment set all traits and properties as both Super Properties and People Properties (If you had Mixpanel People enabled). Now Mixpanel allows you to segment your reports by both People Properties and Super Properties. To give you better precision and control over what property or trait gets set as a Super Property or People Property, you can disable **Set All Traits as Super Properties or People Properties By Default** and pass in the properties or traits that you want to send to Mixpanel as People or Super Properties as shown below. Segment passes through all of Mixpanel's special traits as People Properties so you only need to add the ones that aren't on [this list](#group-using-device-mode).
175-
170+
Previously, Segment set all traits and properties as both Super Properties and People Properties (If you had Mixpanel People enabled). Now Mixpanel allows you to segment your reports by both People Properties and Super Properties. To give you better precision and control over what property or trait gets set as a Super Property or People Property, you can disable **Set All Traits as Super Properties or People Properties By Default** and pass in the properties or traits that you want to send to Mixpanel as People or Super Properties as shown below. Segment passes through all of Mixpanel's special traits as People Properties so you only need to add the ones that aren't on [this list](#group).
176171

177-
![mixpanel people properties list](images/mixpanelpeoplesuperprops.png)
172+
![mixpanel people properties list](/docs/connections/destinations/catalog/mixpanel/images/mixpanelpeoplesuperprops.png)
178173

179174
### Incrementing events
180175

181176
You don't need to add extra code to increment event counts for Mixpanel people, as long as they are "known users". Supply the events that should be incremented.
182177

183-
![mixpanel increment events list](images/mixpanelincrementinpeople.png)
178+
![mixpanel increment events list](/docs/connections/destinations/catalog/mixpanel/images/mixpanelincrementinpeople.png)
184179

185180
You can find this in the **Advanced Options** of your Mixpanel settings on your Segment Destinations page.
186181

@@ -232,4 +227,4 @@ If you're testing in Xcode remember you must first background the app, then the
232227
Push notifications are only available for projects bundling the Segment-Mixpanel SDK.
233228

234229
> info ""
235-
> Set up your push notification handlers by calling into native Mixpanel methods. You can read more about how to approach this in [Android] (/docs/connections/sources/catalog/libraries/mobile/android/android-faqs/#how-can-i-use-a-destination-specific-feature)
230+
> Set up your push notification handlers by calling into native Mixpanel methods. You can read more about how to approach this in [Android](/docs/connections/sources/catalog/libraries/mobile/android/android-faqs/#how-can-i-use-a-destination-specific-feature).

src/connections/sources/catalog/libraries/mobile/kotlin-android/kotlin-android-faq.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The core Segment SDK is extremely lightweight. The JAR weighs in at 12.3KB.
3030
## How should I configure Proguard?
3131

3232
For the Segment SDKs, you can add the following snippet to your Proguard configuration:
33+
3334
```
3435
- keep class com.segment.analytics.** { *; }
3536
- keep class androidx.lifecycle.DefaultLifecycleObserver
@@ -49,42 +50,45 @@ Yes. Please refer to the [Java Compatibility](https://github.com/segmentio/analy
4950

5051
If you're on a version prior to `1.10.4`, the SDK internally uses a number of Java 8 language APIs through desugaring (see [Java 8+ API](https://developer.android.com/studio/write/java8-support#library-desugaring) desugaring support). Please make sure your project either uses Android Gradle plugin 4.0.0 or higher, has a minimum API level of 26, or is upgraded to the latest SDK.
5152

52-
5353
## My deeplinks are not tracked?
5454

55-
5655
While Analytics Kotlin will automatically track deep links that open your app when the `trackDeepLinks` Configuration property is set to `true`. There are some situations when the app is already open that could cause a deep link open event to be missed.
5756

5857
The `openUrl` function allows you to manually track that a deep link has opened your app while your app was already open:
5958

59+
```
60+
override fun onNewIntent(intent: Intent?) {
61+
super.onNewIntent(intent)
62+
63+
// Add a deep-link opened event manually.
64+
// This is necessary when your Activity has a android:launchMode of
65+
// 'singleInstance', 'singleInstancePerTask', 'singleTop', or any other mode
66+
// that will re-use an existing Activity instead of creating a new instance.
67+
// The Analytics SDK automatically identifies when you app is started from
68+
// a deep link if the Activity is created, but not if it is re-used. Therefore
69+
// we have to add this code to manually capture the Deep Link info.
70+
71+
val referrer = "unknown"
72+
analytics.trackDeepLinkOpen(referrer, intent)
73+
}
74+
```
6075

61-
override fun onNewIntent(intent: Intent?) {
62-
super.onNewIntent(intent)
63-
64-
// Add a deep-link opened event manually.
65-
// This is necessary when your Activity has a android:launchMode of
66-
// 'singleInstance', 'singleInstancePerTask', 'singleTop', or any other mode
67-
// that will re-use an existing Activity instead of creating a new instance.
68-
// The Analytics SDK automatically identifies when you app is started from
69-
// a deep link if the Activity is created, but not if it is re-used. Therefore
70-
// we have to add this code to manually capture the Deep Link info.
71-
72-
val referrer = "unknown"
73-
analytics.trackDeepLinkOpen(referrer, intent)
74-
}
75-
76-
Note: Due to the way deep links are handled in Android, we can not know the referrer when a deep link causes `onNewIntent()` to be fired instead of `onCreate()`.
76+
Note: Due to the way deep links are handled in Android, we can not know the referrer when a deep link causes `onNewIntent()` to be fired instead of `onCreate()`.
7777

7878
For a sample implementation see our [Kotlin Sample App](https://github.com/segmentio/analytics-kotlin/tree/main/samples/kotlin-android-app).
7979

8080
## Will I still see device-mode integrations listed as `false` in the integrations object?
81+
8182
When you successfully package a plugin in device-mode, you will no longer see the integration listed as `false` in the integrations object for a Segment event. This logic is now packaged in the event metadata, and is not surfaced in the Segment debugger.
8283

8384
## What is the instanceId set in context?
85+
8486
The instanceId was introduced in [V 1.10.1](https://github.com/segmentio/analytics-kotlin/releases/tag/1.10.1){:target="_blank"} and correlates events to a particular instance of the client in a scenario when you might have multiple instances on a single app.
8587

8688
## How should I configure my proxy URL?
89+
8790
To proxy events to Segment's API, you can configure your proxy URL via the `requestFactory` setting:
91+
8892
```
8993
Analytics(BuildConfig.SEGMENT_WRITE_KEY, androidContext()) {
9094
trackApplicationLifecycleEvents = true
@@ -104,4 +108,4 @@ Analytics(BuildConfig.SEGMENT_WRITE_KEY, androidContext()) {
104108
}
105109
```
106110

107-
When proxying your events, you must forward the batched events to `https://api.segment.io/v1/b`. The `https://api.segment.io/v1/batch` endpoint is reserved for events arriving from server side sending, and proxying to that endpoint for your mobile events may result in unexpected behavior.
111+
When proxying your events, you must forward the batched events to `https://api.segment.io/v1/b`. The `https://api.segment.io/v1/batch` endpoint is reserved for events arriving from server side sending, and proxying to that endpoint for your mobile events may result in unexpected behavior.

src/connections/sources/catalog/libraries/mobile/kotlin-android/kotlin-android-typewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ To learn more about the `typewriter.yml` configuration format, see the [Configur
245245

246246
As mentioned in the [Best Practices](#best-practices) section above, Segment recommends that you only check in the `plan.json`, and not the generated clients, into your version control. Instead, Segment recommends building these clients as part of the build step for your application.
247247

248-
In your CI environment, this usually involves a step to build the Typewriter client. Make sure to build the production client before deploying the application, as explained in the [Tracking Plan Violation Handling](#tracking-plan-violation-handling) section below.
248+
In your CI environment, this usually involves a step to build the Typewriter client. Make sure to build the production client before deploying the application, as explained in [Tracking Plan Violation Handling](/docs/protocols/apis-and-extensions/typewriter/#tracking-plan-violation-handling).
249249

250250
```yaml
251251
# An example (simplified) CircleCI configuration:

src/connections/sources/catalog/libraries/mobile/kotlin-android/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you're using a previous Segment mobile library such as Analytics-Android, fol
1515
1. [Import Analytics-Kotlin](#1-import-analytics-kotlin)
1616
2. [Upgrade your Destinations](#2-upgrade-your-destinations)
1717
3. [Advanced: Upgrade your Middleware](#3-upgrade-middleware-to-plugins)
18-
4. [Upgrade Notes](#4-upgrade-notes-changes-to-the-configuration-object)
18+
4. [Upgrade Notes](#4-upgrade-notes)
1919

2020
## 1. Import Analytics-Kotlin
2121

0 commit comments

Comments
 (0)