You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/mobile/apple/destination-plugins/braze-swift.md
+9-90Lines changed: 9 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Analytics Swift Braze Plugin
4
4
5
5
[Braze](https://www.braze.com/), formerly Appboy, is an engagement platform that empowers growth by helping marketing teams to build customer loyalty through mobile, omni-channel customer experiences.
6
6
7
-
Braze’s destination plugin code is open source and available on GitHub. You can view it [here.](https://github.com/braze-inc/analytics-swift-braze). This destination plugin is maintained by Braze. For any issues with the destination plugin code, please reach out to Braze's support.
7
+
Braze’s destination plugin code is open source and available on GitHub. You can view it [here](https://github.com/braze-inc/analytics-swift-braze). This destination plugin is maintained by Braze. For any issues with the destination plugin code, please reach out to Braze's support.
8
8
9
9
## Getting Started
10
10
@@ -16,16 +16,17 @@ Braze’s destination plugin code is open source and available on GitHub. You ca
16
16
17
17
## Adding the dependency
18
18
19
-
### through Xcode
19
+
### Through Xcode
20
20
In the Xcode `File` menu, click `Add Packages`. You'll see a dialog where you can search for Swift packages. In the search field, enter the URL to this repository.
You'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button.
25
+
You'll then have the option to pin to a version, or specific branch, as well as which project in your workspace to add it to. Once you've made your selections, click the `Add Package` button.
25
26
26
-
### through Package.swift
27
+
### Through Package.swift
27
28
28
-
Open your Package.swift file and add the following do your the `dependencies` section:
29
+
Open your Package.swift file and add the following to the `dependencies` section:
29
30
30
31
```
31
32
.package(
@@ -53,14 +54,6 @@ let analytics = Analytics(configuration: Configuration(writeKey: "<YOUR WRITE KE
53
54
.trackApplicationLifecycleEvents(true))
54
55
analytics.add(plugin: BrazeDestination())
55
56
```
56
-
## Screen
57
-
If you're not familiar with the Segment Specs, take a look to understand what the [Page method](/docs/connections/spec/page/) does. An example call would look like:
58
-
59
-
```swift
60
-
analytics.screen(title: "SomeScreen")
61
-
```
62
-
63
-
Segment sends Page calls to Braze as custom events if you have enabled either **Track All Pages** or **Track Only Named Pages** in the Segment Settings.
64
57
65
58
## Identify
66
59
@@ -135,81 +128,7 @@ Segment sends all other traits (except Braze's [reserved user profile fields](ht
135
128
> info "Tip"
136
129
> To lower [Data Point](https://www.braze.com/docs/user_guide/onboarding_with_braze/data_points/) use, limit the events you send to Braze to those that are relevant for campaigns and segmentation to the Braze destination. For more information, see [Schema Controls](/docs/protocols/schema/).
137
130
138
-
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example call looks like:
139
-
140
-
```swift
141
-
structTrackProperties: Codable {
142
-
let someValue: String
143
-
}
144
-
145
-
analytics.track(name: "My Event", properties: TrackProperties(someValue: "Hello"))
146
-
```
147
-
When you `track` an event, Segment sends that event to Braze as a custom event.
148
-
149
-
> note ""
150
-
> Braze requires that you include a `userId` or `braze_id` for all calls made in cloud-mode. Segment sends a `braze_id` if `userId` is missing. When you use a device-mode connection, Braze automatically tracks anonymous activity using the `braze_id` if a `userId` is missing.
151
-
152
-
> note ""
153
-
> Segment removes the following custom properties reserved by Braze:
154
-
>
155
-
> -`time`
156
-
> -`quantity`
157
-
> -`event_name`
158
-
> -`price`
159
-
> -`currency`
160
-
161
-
### Order Completed
162
-
163
-
When you `track` an event with the name `Order Completed` using the [e-commerce tracking API](/docs/connections/spec/ecommerce/v2/), Segment sends the products you've listed to Braze as purchases.
164
-
165
-
### Purchases
166
-
167
-
When you pass [ecommerce events](/docs/connections/spec/ecommerce/v2/), the name of the event becomes the `productId` in Braze. An example of a purchase event looks like:
The example above would have "Purchased Item" as its `productId` and includes two required properties that you must pass in:
179
-
180
-
-`revenue`
181
-
-`currency`
131
+
The Braze Swift destination plugin currently only supports sending `logPurchase` events, and custom events are not supported in device mode. Please review the [plugin code](https://github.com/braze-inc/analytics-swift-braze/blob/main/Sources/SegmentBraze/BrazeDestination.swift) for more information.
182
132
183
133
Braze supports currency codes as specified in [their Purchase Object Specification](https://www.braze.com/docs/api/objects_filters/purchase_object/). Be aware that any currency reported other than USD displays in [the Braze UI in USD based on the exchange rate on the date it was reported](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/analytics/logging_purchases/#logging-purchases).
184
134
185
-
You can add more product details in the form of key-value pairs to the `properties` object. The following reserved keys are not passed to Braze if included in your Track call's `properties` object:
186
-
187
-
-`time`
188
-
-`product_id`
189
-
-`quantity`
190
-
-`event_name`
191
-
-`price`
192
-
193
-
194
-
## Group
195
-
196
-
If you're not familiar with the Segment Specs, take a look to understand what the [Group method](/docs/connections/spec/group/) does. An example call would look like:
When you call `group`, Segment sends a custom attribute to Braze with the name `ab_segment_group_<groupId>`, where `<groupId>` is the group's ID in the method's parameters. For example, if the group's ID is `1234`, then the custom attribute name is `ab_segment_group_1234`. The value of the custom attribute is `true`.
0 commit comments