Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous how-to doc edits (part 1) #5513

Merged
merged 5 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/guides/how-to-guides/automated-multichannel-reengagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ title: Automating Multi-Channel Re-Engagement Campaigns

Compelling and engaging brands delight their customers at every interaction. As customers move seamlessly across channels—such as email, push notifications, display ads—brands must similarly meet them with tailored and consistent messages.

We'll show you how to craft a tailored message while using a combination of AdRoll, Customer.IO, and other tools to dynamically switch between channels.
With Segment, you can craft a tailored message while using a combination of AdRoll, Customer.IO, and other tools to dynamically switch between channels.

[Talk to a product specialist today](https://segment.com/contact/sales) about using data to tailor your brand experience.
[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} about using data to tailor your brand experience.

## Tools used

* Retargeting with [AdRoll](https://adroll.com/): _AdRoll is a retargeting and prospecting tool that allows you to show display ads to a behaviorally-defined cohort_
* Retargeting with [AdRoll](https://adroll.com/){:target="_blank"}: _AdRoll is a retargeting and prospecting tool that allows you to show display ads to a behaviorally-defined cohort_

* Push notifications with [Braze](https://braze.com/): _Braze is a multi-channel marketing campaign focused on the mobile experience_
* Push notifications with [Braze](https://braze.com/){:target="_blank"}: _Braze is a multi-channel marketing campaign focused on the mobile experience_

* Emails with [Customer.io](https://customer.io/): _Customer.io is a flexible email provider that allows you to create cohorts based on customer actions. You can build complex onboarding emails, nurture email campaigns, as well as marketing automation workflows._
* Emails with [Customer.io](https://customer.io/){:target="_blank"}: _Customer.io is a flexible email provider that allows you to create cohorts based on customer actions. You can build complex onboarding emails, nurture email campaigns, as well as marketing automation workflows._


_There are other email tools on Segment's platform, such as_ [Bronto](https://bronto.com/), [SendGrid](https://sendgrid.com/), _and_ [Mailchimp](https://mailchimp.com/). _Check out the_ [full list of email tools](https://segment.com/catalog#integrations/email).
_There are other email tools on Segment's platform, such as_ [Bronto](https://bronto.com/){:target="_blank"}, [SendGrid](https://sendgrid.com/){:target="_blank"}, _and_ [Mailchimp](https://mailchimp.com/){:target="_blank"}. _Check out the_ [full list of email tools](https://segment.com/catalog#integrations/email){:target="_blank"}.

Before we proceed, it's important to register for these tools and enable them on your Segment source project. When Segment collects tracking data, it'll also route it to all of your enabled tools. Then your tools, especially ones like Customer.io, Braze, and AdRoll, where you can define cohorts of your users, will be working off a dynamic, yet consistent data set. This is paramount in getting the dynamic messaging to update accordingly.
It's important to register for these tools and enable them on your Segment source project. When Segment collects tracking data, it'll also route it to all of your enabled tools. Then your tools, especially ones like Customer.io, Braze, and AdRoll, where you can define cohorts of your users, will be working off a dynamic, yet consistent data set. This is paramount in getting the dynamic messaging to update accordingly.

## Set it up

Expand All @@ -29,34 +29,34 @@ When you send tracking data from your app or website to Segment, Segment will se

In each of your destinations—Braze, Facebook, Customer.io, AdRoll—you can create custom campaigns to show display ads or send emails to a specific segment of users who have performed (or not performed) a given action, or "event." In this cross-channel re-engagement example, we'll start with push notifications.

## 1st Line of Defense: The Push Notification
## 1st line of defense: the push notification

In Braze, create a segment of customers who added a product to their cart, but did not check out. The segment definition, in this case, should be people who have performed `Product Added`, but have not performed `Order Completed` . Send a push notification to these customers with a message that the cart was abandoned and that they can complete the transaction with a 10% coupon (or up to you).
In Braze, create a segment of customers who added a product to their cart, but did not check out. The segment definition, in this case, should be people who have performed `Product Added`, but have not performed `Order Completed` . Send a push notification to these customers with a message that the cart was abandoned and that they can complete the transaction with, for example, a 10% coupon.

![An Apple iPhone with a push notification from Toastmates that says Oh no! You left something in your basket.](images/auto-multi_DDMDnUuY.png)

## 2nd Line of Defense: The Email Reminder
## 2nd line of defense: the email reminder

Because Segment automatically collects second-party data from Braze, you now also have push notification event data, like `Push Notification Opened` and `Push Notification Received` in Segment. You can use the `properties` on each of these events to define a property called `campaign_name` so you can tie these activities to a given campaign.

![Screenshot of an email from Toastmates reminding the customer that they have a toast in their cart and giving them a coupon and a direct link to their cart.](images/auto-multi_262jquPl.png)

This is helpful because now, you can define segments in Customer.io for customers who have triggered `Push Notification Received`, but not `Push Notification Opened` . You've now automated the process of targeting customers who don't open your push notifications. In Customer.io, From here, you can create a campaign that sends an email to those people asking them to check their push notifications and offering them a coupon to complete their order.
This is helpful because now, you can define segments in Customer.io for customers who have triggered `Push Notification Received`, but not `Push Notification Opened` . You've now automated the process of targeting customers who don't open your push notifications. In Customer.io, you can create a campaign that sends an email to those people asking them to check their push notifications and offering them a coupon to complete their order.

## 3rd Line of Defense: Paid Advertising
## 3rd line of defense: paid advertising

Since Segment collects email event data, like `Email Opened`, from Customer.io, you can similarly create segments in Facebook Ads and AdRoll for when customers don't open your email. Create a segment where users have an `Email Delivered` event, but no `Email Opened` event. When users meet these criteria, they'll get automatically added to your retargeting campaigns. You can then serve them custom creatives about them neglecting to open your emails and, again, perhaps offer them a coupon to complete the transaction.

![An ad for Toastmates with a frowning face on a piece of toast and a link for a coupon.](images/auto-multi_dI5srBtw.png)

When users do not open an activation email, we can seamlessly add them to a specific retargeting campaign that contains messaging to remind them to activate.
When users do not open an activation email, add them to a specific retargeting campaign that contains messaging to remind them to activate.

With Segment, we can automate not just switching across channels, but also the messaging in each channel so that the entire experience is cohesive. The added benefit is that we can create specifically targeted retargeting campaigns for people who no longer open our emails or push notifications. Automating these processes with Segment makes channel-switching more seamless for your customers.
With Segment, automate not just switching across channels, but also the messaging in each channel so that the entire experience is cohesive. The added benefit is that we can create specifically targeted retargeting campaigns for people who no longer open our emails or push notifications. Automating these processes with Segment makes channel-switching more seamless for your customers.

## Create an engaging and consistent brand experience

This is just a simple cart abandonment example that dynamically follows our customers as they switch between channels. Because Segment collects and routes the second party data of emails and push notifications being opened, we are able to create specific campaigns with messaging that targets your customers as they interact with your brand.
This is just a simple cart abandonment example that dynamically follows customers as they switch between channels. Because Segment collects and routes the second party data of emails and push notifications being opened, you can create specific campaigns with messaging that targets your customers as they interact with your brand.

With over 200+ different tools on our platform, you can take this idea and create other tailored shopping experiences to re-engage your customers.
With over 200+ different tools on Segment's platform, you can take this idea and create other tailored shopping experiences to re-engage your customers.

[Talk to a product specialist today](https://segment.com/contact/sales) _about using data to tailor your brand experience._
[Talk to a product specialist today](https://segment.com/contact/sales){:target="_blank"} _about using data to tailor your brand experience._
14 changes: 7 additions & 7 deletions src/guides/how-to-guides/collect-on-client-or-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
title: Collecting Data on the Client or Server
---

One of the most common questions we receive is: "Should I use one of your client-side libraries or one of your server-side libraries?"
One of the most common questions Segment receives is: "Should I use one of your client-side libraries or one of your server-side libraries?"


This is such an important topic that we've written up an in-depth article in our Analytics Academy:  [When to Track on the Client vs Server](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/). It's worth a read. Below, you can also read some quick logic around why you may want to choose either option.
This is such an important topic that you'll find an in-depth article in Segment's Analytics Academy:  [When to Track on the Client vs Server](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/){:target="_blank"}. It's worth a read. Below, you can also read some quick logic around why you may want to choose either option.

### Client-side

#### Not stored in your database

Good things to send from the client-side are things that you wouldn't usually store in your database. Things like page views, button clicks, page scroll length, mouse movements, social shares and likes.
Good things to send from the client-side are things that you wouldn't usually store in your database. Things like page views, button clicks, page scroll length, mouse movements, social shares, and likes.

#### Easier to send client-side

Things like UTM tags, operating system, device type, or cookied data like returning visitors are all easiest to track client-side. Of course, some things like mouse movements are only available on the client-side so you should definitely track that there.

#### Events needed for client-side only destinations

Some destinations can only accept data when the event is sent from the browser. They require events on the client since they rely on cookies and most of those tools do not have an API that Segment can send server-side data to. More on this in our Analytics.js docs.
Some destinations can only accept data when the event is sent from the browser. They require events on the client since they rely on cookies and most of those tools do not have an API that Segment can send server-side data to. More on this in Segment's [Analytics.js docs](/docs/connections/sources/catalog/libraries/website/javascript/cookie-validity-update/#client-side-persistence-in-analytics-js).

### Server-side

Expand All @@ -31,7 +31,7 @@ Charging customers often happens when they aren't online, and accuracy for payme

In general client-side data is fine for watching general trending, but it's never going to be perfect. Especially if your customers are likely to use things like adblock or old/non-standard browsers.

For example, if you're sending triggered emails based on events, it's probably a good idea to make sure your user profiles are sent through our servers so no one gets left out or mis-emailed.
For example, if you're sending triggered emails based on events, it's probably a good idea to make sure your user profiles are sent through Segment's servers so no one gets left out or mis-emailed.

#### Calculated from your database

Expand All @@ -43,9 +43,9 @@ Sensitive information is also best kept out of browsers. Any data you don't want

### Selecting Destinations

Each Segment library allows an `integrations` object either as a top level object or nested in options object. [Check your library docs](https://segment.com/docs/connections/sources/) for details; look for the section titled ["Selecting Destinations"](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#selecting-destinations-with-the-integrations-object).
Each Segment library allows an `integrations` object either as a top level object or nested in options object. [Check your library docs](/docs/connections/sources/) for details; look for the section titled ["Selecting Destinations"](/docs/connections/sources/catalog/libraries/website/javascript/#selecting-destinations-with-the-integrations-object).

This flag may be especially useful in Legacy source types, where an event might be triggered on both the client & server for various reasons. The following will cause the payload to be sent to all enabled tools EXCEPT Facebook Pixel:
This flag may be especially useful in Legacy source types, where an event might be triggered on both the client and server for various reasons. The following will cause the payload to be sent to all enabled tools **except** Facebook Pixel:

```js
analytics.identify('user_123', {
Expand Down
6 changes: 3 additions & 3 deletions src/guides/how-to-guides/collect-pageviews-serverside.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ With this approach, you might use a request "middleware" to log a `pageview` w

There are a few things to be mindful of if you want to make sure you can attribute these (anonymous) page views to the appropriate user in your client-side source (eg, for effectively joining these tables together to do down-funnel behavioral attribution). You'll want to ensure they share an `anonymousId` by respecting one if it's already there, and setting it yourself if not. To do that, you can read and modify the `ajs_anonymous_id` cookie value in the request.

Be sure to pass through as many fields as you can in our [page](https://segment.com/docs/connections/spec/page/) and [context](https://segment.com/docs/connections/spec/common/) spec, so that you get full functionality in any downstream tools you choose to enable. We recommend specifically ensuring you pass the **url, path, host, title, search, and referrer** in the message `properties` and **ip and user-agent** in the message `context` .
Be sure to pass through as many fields as you can in Segment's [page](/docs/connections/spec/page/) and [context](/docs/connections/spec/common/) spec, so that you get full functionality in any downstream tools you choose to enable. Segment recommends specifically ensuring you pass the **url, path, host, title, search, and referrer** in the message `properties` and **ip and user-agent** in the message `context` .
rchinn1 marked this conversation as resolved.
Show resolved Hide resolved

Here's an example of an express middleware function that covers all those edge cases!
Here's an example of an express middleware function that covers all those edge cases:

If you have any questions or would like help generally adopting this method for other languages and frameworks, be sure to [get in touch](https://segment.com/help/contact/).
If you have any questions or would like help generally adopting this method for other languages and frameworks, be sure to [get in touch](https://segment.com/help/contact/){:target="_blank"}.

```js
import express from 'express'
Expand Down
Loading