|
| 1 | +--- |
| 2 | +title: ABsmartly (Actions) Destination |
| 3 | +--- |
| 4 | + |
| 5 | +{% include content/plan-grid.md name="actions" %} |
| 6 | + |
| 7 | +[ABsmartly](https://absmartly.com/?utm_source=segmentio&utm_medium=docs&utm_campaign=partners){:target="_blank"} provides an on-premise, full-stack experimentation platform for engineering and product teams that do continuous experimentation embedded into their development process. A/B Smartly's real-time analytics helps engineering and product teams ensure that new features will improve the customer experience without breaking or degrading performance and/or business metrics. |
| 8 | + |
| 9 | +This destination is maintained by ABsmartly. For any issues with the destination, [contact ABsmartly's Support ](mailto:[email protected]). |
| 10 | + |
| 11 | +## Benefits of ABsmartly (Actions) vs A/B Smartly Classic |
| 12 | + |
| 13 | +- **Easier Setup**. Actions-based destinations are easier to configure with clear default settings enabling you to get started quickly. |
| 14 | +- **Control and clearer mapping**. Actions-based destinations enable you to define the mapping between the data Segment receives from your source, and the data Segment sends to the ABsmartly. |
| 15 | + |
| 16 | +## Getting started |
| 17 | + |
| 18 | +1. From the Segment web app, click **Catalog**. |
| 19 | +2. Search for "ABsmartly" in the Catalog, select **ABsmartly (Actions)**, and choose which of your sources to connect the destination to. |
| 20 | +3. Add the following Connection Settings: |
| 21 | + - **Collector Endpoint**: Your ABsmartly Collector REST Endpoint. Usually `https://<your-subdomain>.absmartly.io/v1` |
| 22 | + - **API Key**: An existing API Key. Created under Settings->API Keys in the ABsmartly Web Console. |
| 23 | + - **Environment**: The environment where the events are originated matching an existing environment in ABsmartly. Created under Settings->Environments in the ABsmartly Web Console. |
| 24 | + |
| 25 | +{% include components/actions-fields.html %} |
| 26 | + |
| 27 | +> info "" |
| 28 | +> If you need support setting things up, you can contact the ABsmartly support team on Slack or via email at [ABsmartly's Support](mailto:[email protected]). |
| 29 | +
|
| 30 | +# Sending exposures to Segment |
| 31 | + |
| 32 | +It can be useful to send experiment exposures to Segment for visibility from |
| 33 | +other destinations. The Segment spec includes the [Experiment Viewed semantic event](https://segment.com/docs/connections/spec/ab-testing/) |
| 34 | +for this purpose. |
| 35 | + |
| 36 | +> info "" |
| 37 | +> By default, the _Track Calls_ action will filter and not send to ABsmartly events with name `Experiment Viewed`. |
| 38 | +
|
| 39 | +In the ABsmartly context, we can [install a custom event logger](https://docs.absmartly.com/docs/sdk%20documentation/getting-started/#using-a-custom-event-logger) and send exposures directly to Segment. |
| 40 | + |
| 41 | +```javascript |
| 42 | +analytics.ready(function() { |
| 43 | + // initialize ABsmartly SDK |
| 44 | + const sdk = new absmartly.SDK({ |
| 45 | + endpoint: 'https://your-absmartly-endpoint.absmartly.io/v1', |
| 46 | + apiKey: '<YOUR-API-KEY>', |
| 47 | + environment: 'development', |
| 48 | + application: 'YOUR-APP', |
| 49 | + eventLogger: (context, eventName, data) => { |
| 50 | + if (eventName == "exposure") { |
| 51 | + // filter only relevant and interesting exposures |
| 52 | + // if the assigned flag is false, this exposure was a treatment call that did not result in an assignment |
| 53 | + // this can happen if, for example, the experiment is no longer running, but treatment() calls are still in the application code |
| 54 | + if (exposure.assigned) { |
| 55 | + analytics.track("Experiment Viewed", { |
| 56 | + experiment_id: exposure.id, |
| 57 | + experiment_name: exposure.name, |
| 58 | + variation_id: exposure.variant, |
| 59 | + variation_name: "ABCDEFG"[exposure.variant], |
| 60 | + }); |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + }); |
| 65 | + |
| 66 | + const context = sdk.createContext(request); |
| 67 | + context.attribute("user_agent", navigator.userAgent); |
| 68 | + |
| 69 | + context.ready().then((response) => { |
| 70 | + console.log("ABSmartly Context ready!"); |
| 71 | + console.log(context.treatment("test-exp")); |
| 72 | + }).catch((error) => { |
| 73 | + console.log(error); |
| 74 | + }); |
| 75 | +}); |
| 76 | +``` |
| 77 | + |
| 78 | +## Migration from the classic A/B Smartly destination |
| 79 | + |
| 80 | +To migrate from the classic A/B Smartly destination to ABsmartly (Actions) be sure to disconnect the classic A/B Smartly destination before enabling the ABsmartly (Actions) destination to avoid duplicate experimentation events in ABsmartly. |
| 81 | + |
| 82 | +--- |
| 83 | + |
0 commit comments