Overview
Segment has some great documentation on how their functions work.
We encourage you to check it out - [Click Here]
How-To Guide with Example
The steps below will follow an example which will be using the onTrack function to watch for analytics.track() events sent to Segment and then pull data out such as userId or email to send that to Everflow.
Step #1 - Configure Event In Everflow
- Configure the Advertiser-Level Event for tracking from Segment to Everflow.
Step #2 - Copy Values From Everflow
- Pull your Tracking Domain, Advertiser ID (aid), and Advertiser Event ID (adv_event_id) and implement it inside the code below.
Here is where to find the aid and adv_event_id. In this example, the aid is 139 and the adv_event_id is 26.

- Scroll down to locate your Tracking Domain on the Tracking card. In this example, it is https://www.serve-eflow-test.com.

Your Tracking card could look different if Javascript SDK is not selected as the Conversion Method.
If so, edit the the Conversion Method before moving on by:
- Navigating to Edit > Attribution > Conversion Method: Javascript SDK.
Step #3 - Code Prep
- Copy the following code so that you may paste it into Segment. Be sure to replace INSERT_TRACKING_DOMAIN, INSERT_AID, and INSERT_ADV_EVENT_ID with the values you copied in Step #2.
Below is an example showing the code with our sample values plugged in:
Step #4 - Configure Function In Segment
- In Segment, navigate to Catalog > Functions.

- Then, click the blue [+ New Function] button on the upper right side.
- Select Destination, then click Build.

Step #5 - Implement Code In Segment
- Delete the code example that is currently in the box.

- Replace it with the code you prepared in Step #3, then click Configure.

Step #6 - Tie Event To Destination In Segment
- Name the function and click Create Function.

- Then, click [+ Connect Destination].

- Select the destination.

- Then, name it and click Save.

Step #7 - Test
- You are now ready to test!
More Information
- Use the following code if you would like to fire the conversion only on specific events:
- You must replace 'test' with the name of the event inside Segment. You can find the name of the event by clicking Sources, clicking the source and then the Debugger.

