Skip to content

Commit 6a5f5c1

Browse files
authored
Merge pull request #366 from segmentio/repo-sync
repo sync
2 parents f9ccad2 + c8f4e7a commit 6a5f5c1

File tree

3 files changed

+25
-33
lines changed

3 files changed

+25
-33
lines changed

src/connections/destinations/catalog/actions-google-analytics-4/index.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,15 @@ Google Analytics 4 has different out-of-the-box reports. Google Analytics 4’s
5757
Segment’s Google Analytics 4 integration is a server-side integration with the GA4 Measurement Protocol API. This is similar to Segment’s Google Universal Analytics cloud-mode integration in that all data is sent directly to Google’s servers. Please note that this means client-side functionality, such as [Enhanced Measurement](https://support.google.com/analytics/answer/9216061){:target='_blank'}, may not be available through Segment. In addition, as Google continues to develop the GA4 Measurement Protocol API ahead of general availability of the API, there may be limitations that impact what can be seen in the Google Analytics 4 reports.
5858

5959
#### Recommended Events
60-
Google Analytics 4 requires the use of [recommended events and properties](https://support.google.com/analytics/answer/9267735){:target='_blank'} to power certain built-in reports. Segment’s Google Analytics 4 destination will automatically map your [Segment spec](/docs/connections/spec/ecommerce/v2) events to the corresponding Google Analytics 4 events and properties. If your Segment events don't follow the Segment spec exactly, you can modify the mappings. For example, Segment maps "Order Completed" events to the Google Analytics 4 “Purchase” event by default. However, if your company uses “Products Purchase” to indicate a purchase, this can be mapped in the Purchase action’s Event Trigger instead.
60+
Google Analytics 4 requires the use of [recommended events and properties](https://support.google.com/analytics/answer/9267735){:target='_blank'} to power certain built-in reports. Segment’s Google Analytics 4 destination provides prebuilt mappings to automatically map your [Segment spec](/docs/connections/spec/ecommerce/v2) events to the corresponding Google Analytics 4 events and properties. If your Segment events don't follow the Segment spec exactly, you can modify the mappings. For example, Segment maps "Order Completed" events to the Google Analytics 4 “Purchase” event by default. If your company uses “Products Purchase” to indicate a purchase, this can be mapped in the Purchase action’s Event Trigger instead.
6161

62-
Segment’s spec doesn't have an equivalent event for every Google Analytics 4 recommended event. If there are other recommended events you would like to send, please use the [Custom Event action](/docs/connections/destinations/catalog/actions-google-analytics-4/#custom-event). For example, to send a `spend_virtual_currency` event, create a mapping for Custom Event, set up your Event Trigger criteria, and input a literal string of "spend_virtual_currency" as the Event Name. You can use the Event Parameters object to add fields that are in the `spend_virtual_currency` event such as `value` and `virtual_currency_name`.
62+
Segment recommends using the prebuilt mappings when possible, however the Segment spec doesn't have an equivalent event for every Google Analytics 4 recommended event. If there are other recommended events you would like to send, please use the [Custom Event action](/docs/connections/destinations/catalog/actions-google-analytics-4/#custom-event). For example, to send a `spend_virtual_currency` event, create a mapping for Custom Event, set up your Event Trigger criteria, and input a literal string of "spend_virtual_currency" as the Event Name. You can use the Event Parameters object to add fields that are in the `spend_virtual_currency` event such as `value` and `virtual_currency_name`.
6363

6464
#### Custom Events
6565
In addition to recommended events, you can also send custom events using the [Custom Event action](/docs/connections/destinations/catalog/actions-google-analytics-4/#custom-event). Custom events are events that you name. Custom events don't appear in most standard reports; you need to set up custom reports for meaningful analysis. To create custom events in the Google Analytics 4 web interface, see Google’s [Modify and create events through the user interface](https://support.google.com/analytics/answer/10085872){:target='_blank'}.
6666

67-
> warning ""
68-
> Don’t create custom events that already correspond to the pre-built mappings that Segment has. Use the standard events defined in [GA4’s doc](https://developers.google.com/analytics/devguides/collection/ga4/reference/events){:target="_blank"} with their corresponding actions.
69-
70-
info "Event naming limitations"
71-
Google Analytics 4 requires that all event names contain only alpha-numeric characters and underscores, and must start with an alphabetic character. Segment replaces spaces in Event Names with an underscore, so that these events are accepted by GA4. For example, Segment renames an event named `Home Profile` to `Home_Profile`. In some cases, GA4 may reject an event outright, due to unsupported characters. For example, an event named `Home | Profile` will be silently rejected due to the pipe character.
67+
> info "Event naming limitations"
68+
> Google Analytics 4 requires that all event names contain only alpha-numeric characters and underscores, and must start with an alphabetic character. Segment replaces spaces in Event Names with an underscore, so that these events are accepted by GA4. For example, Segment renames an event named `Home Profile` to `Home_Profile`. In some cases, GA4 may reject an event outright, due to unsupported characters. For example, an event named `Home | Profile` will be silently rejected due to the pipe character.
7269
7370
In all cases, event names in GA4 are case sensitive. The Custom Event action includes a **Lowercase Event Name** option, to ensure consistency of all events sent to Google. For more information, see Google's articles [Google Analytics 4 event name rules](https://support.google.com/analytics/answer/10085872?hl=en&ref_topic=9756175#event-name-rules){:target='_blank'} and [Event name limitations](https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=firebase){:target="_blank"}.
7471

src/connections/destinations/catalog/actions-launchdarkly/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To get started with LaunchDarkly (Actions):
4444

4545
## Creating LaunchDarkly metrics
4646

47-
In order to take full-advantage of the LaunchDarkly (Actions) Destination, you need to create metrics in LaunchDarkly that correspond to Segment track events. Read [Creating metrics](https://docs.launchdarkly.com/home/experimentation/metrics/index){:target="_blank"} to learn how to create metrics in LaunchDarkly.
47+
In order to take full-advantage of the LaunchDarkly (Actions) Destination, you need to create metrics in LaunchDarkly that correspond to Segment track events. Read [Creating metrics](https://docs.launchdarkly.com/home/experimentation/metrics){:target="_blank"} to learn how to create metrics in LaunchDarkly.
4848

4949
<!-- If applicable, add information regarding the migration from a classic destination to an Actions-based version below -->
5050

src/connections/functions/aws-apis.md

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,41 @@ To set up your functions to call AWS APIs:
1313
2. Create an IAM role in your AWS account with the [minimum set of necessary permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege){:target="_blank"}.
1414
3. Add a trust relationship to your role with the following policy, filling in the principal account ID and external ID from step 1.1:
1515
```json
16-
{
17-
"Version": "2012-10-17",
18-
"Statement": [
19-
{
20-
"Effect": "Allow",
21-
"Principal": {
22-
"AWS": "<PRINCIPAL_ACCOUNT_ID>"
23-
},
24-
"Action": "sts:AssumeRole",
25-
"Condition": {
26-
"StringEquals": {
27-
"sts:ExternalId": "<EXTERNAL_ID>"
16+
{
17+
"Version": "2012-10-17",
18+
"Statement": [
19+
{
20+
"Effect": "Allow",
21+
"Principal": {
22+
"AWS": "<PRINCIPAL_ACCOUNT_ID>"
23+
},
24+
"Action": "sts:AssumeRole",
25+
"Condition": {
26+
"StringEquals": {
27+
"sts:ExternalId": "<EXTERNAL_ID>"
28+
}
2829
}
2930
}
30-
}
31-
]
32-
}
31+
]
32+
}
3333
```
3434

3535
2. Create your function.
3636
<br> Now that you have an IAM role in your AWS account, you can create your source or destination function. Segment recommends you to use function settings to make the IAM role configurable. This allows you to use different roles for different instances of your function and to securely store your external ID value by making it a "sensitive" setting. Here are the required settings:
3737
* **IAM Role ARN**: A string setting that is the ARN for the IAM role above. For example, `arn:aws:iam::1234567890:role/my-secure-role`.
3838
* **IAM Role External ID**: A sensitive string setting that is the external ID for your IAM role.
3939

40-
Below is an example destination function that uploads each event received to an S3 bucket (configured using an additional "S3 Bucket" setting). It uses the built-in local cache to retain S3 clients between requests to minimize processing time and to allow different instances of the function to use different IAM roles.
40+
Below is an example destination function that uploads each event received to an S3 bucket (configured using additional "S3 Bucket" and "S3 Bucket Region" settings). It uses the built-in local cache to retain S3 clients between requests to minimize processing time and to allow different instances of the function to use different IAM roles.
4141

4242
```javascript
4343
async function getS3(settings) {
4444
const ttl = 30 * 60 * 1000; // 30 minutes
45-
const key = settings.iamRoleArn + settings.iamRoleExternalId;
45+
const key = [settings.iamRoleArn, settings.s3Bucket].join();
4646

4747
return cache.load(key, ttl, async () => {
4848
const sts = new AWS.STS();
4949

50-
const creds = await sts
50+
const opts = await sts
5151
.assumeRole({
5252
RoleArn: settings.iamRoleArn,
5353
ExternalId: settings.iamRoleExternalId,
@@ -56,16 +56,14 @@ To set up your functions to call AWS APIs:
5656
.promise()
5757
.then(data => {
5858
return {
59+
region: settings.s3BucketRegion,
5960
accessKeyId: data.Credentials.AccessKeyId,
6061
secretAccessKey: data.Credentials.SecretAccessKey,
6162
sessionToken: data.Credentials.SessionToken
6263
};
63-
})
64-
.catch(err => {
65-
throw err;
6664
});
6765

68-
return new AWS.S3(creds);
66+
return new AWS.S3();
6967
});
7068
}
7169

@@ -81,9 +79,6 @@ To set up your functions to call AWS APIs:
8179
.promise()
8280
.then(data => {
8381
console.log(data);
84-
})
85-
.catch(err => {
86-
throw err;
8782
});
8883
}
8984
```

0 commit comments

Comments
 (0)