owned this note
owned this note
Published
Linked with GitHub
---
[Kameleoon](https://kameleoon.com/en) & Segment.io integration
---
GDPR, CCPA, and HIPAA compliant, Kameleoon's powerful and easy-to-use A/B testing, full stack, and AI-powered personalization solutions help marketers, product owners, and developers maximize customer engagement and conversion - all from a single platform.
This destination is maintained by Kameleoon. For any issues with the destination, [contact the Kameleoon Support team](mailto:support@kameleoon.com).
## Getting Started
{% include content/connection-modes.md %}
Segment’s Kameleoon destination supports the following Kameleoon products:
* [Kameleoon Experiment](https://www.kameleoon.com/en/platform/ab-testing-client-side) (Web Client-side)
* [Kameleoon Full Stack](https://www.kameleoon.com/en/platform/ab-testing-full-stack) (Web or mobile Apps, IoT..)
* [Kameleoon AI Personalization](https://www.kameleoon.com/en/platform/personalization) (Web Client-side)
First, you will have to request an API Key in order to use Kameleoon & Segment.io integration. You can request it to [support@kameleoon.com](mailto:support@kameleoon.com), by specifying your Kameleoon **account login**.
You will also need to get your **sitecode** key. You can find it from your [Kameleoon Account].(https://help.kameleoon.com/question/how-do-i-find-my-site-id/)
1. From the Destinations catalog page in the Segment App, click **Add Destination**.
2. Search for "Kameleoon" in the Destinations Catalog, and select the "Kameleoon" destination.
3. Choose which Source should send data to the "Kameleoon" destination.
6. Enter the **API Key** and the **sitecode** in the "Kameleoon" destination settings in Segment.
## Implementation pre-requisites: matching Users between Kameleoon and Segment
The integration requires that you use the same system of identifiers for both tools, meaning the **userId** value you pass to Segment should be the same value as Kameleoon uses to identify a "visitor".
If you use Kameleoon Experiment or Kameleoon AI Personalization on your website, Kameleoon places a cookie that contains an anonymous unique identifier, called the Kameleoon visitorcode, randomly assigned to a visitor. This ID is used to uniquely identify a browser. You can either pass our **visitorcode** in the **userId** property of the Segment calls to ensure Kameleoon can consolidate data and avoid any analytics discrepancies between the tools in your campaign results OR you may specify in all Segment calls an additional user property, **k_visitorCode**, whose value is the Kameleoon visitorcode. You can retrieve the user visitorCode from the browser by using our [Activation API](https://developers.kameleoon.com/activation-api.html#visitor). You can retrieve it by using this API method:```Kameleoon.API.Visitor.code```.
If you are not able to update your existing Segment tracking plan, you can also pass our visitor code in an additional Segment call as follow:```analytics.track('Kameleoon identifier', {'k_visitorCode': Kameleoon.API.Visitor.code});```Kameleoon will automatically link your internal user ID or anonymous ID to our own visitorCode. Make sure to call it only once per session.
If you use Kameleoon Full Stack, please refer to the [Kameleoon SDK documentation](https://developers.kameleoon.com/sdks-overview.html). We always recommend to use your own internal ID to identify users.
## Supported methods
Kameleoon supports the following methods, as specified in the [Segment Spec](/docs/connections/spec).
Behind the scenes, if the Segment event name matches exactly the name of an existing [goal](https://help.kameleoon.com/create-new-goal/) in your Kameleoon account, a conversion for this goal will be associated to the visitor. If the goal does not exist, Kameleoon will create a [custom goal](https://help.kameleoon.com/create-new-goal/#Custom_goal) by using the Segment event name and associate the conversion to the visitor. The goal will appear in the Kameleoon [goals page](https://help.kameleoon.com/manage-goals/) with the name convention 'SegmentIO eventType - eventName'. Once the goal has been created, you can use them in any of your [campaign](https://https://help.kameleoon.com/set-up-goal-campaign/).
### Page
Send [Page](https://segment.com/docs/connections/spec/page/) calls to record whenever a user sees a page of your website, along with any optional properties about the page. Calling page or screen in one of our sources is one of the first steps to getting started with Segment.
For example:
```js
analytics.page('Home', {"k_visitorCode": "oa16i4syt2ve3b0z"});
```
### Screen
Send [Screen](https://segment.com/docs/connections/spec/screen/) calls to record whenever a user sees a screen, the mobile equivalent of page, in your mobile app, along with any properties about the screen. Calling page or screen in one of our sources is one of the first steps to getting started with Segment.
For example:
```obj-c
[[SEGAnalytics sharedAnalytics] screen:@"Home"
properties:@{ @"k_visitorCode": @"oa16i4syt2ve3b0z" }];
```
Segment sends Screen calls to Kameleoon as a `screenview`.
### Track
Send [Track](https://segment.com/docs/connections/spec/track/) calls to record any actions your users perform, along with any properties that describe the action.
For example:
```js
analytics.track('Login Button Clicked', {"k_visitorCode": "oa16i4syt2ve3b0z"});
```
Segment sends Track calls to Kameleoon as a `track` event.
---