Optimizely कनेक्टर

experiment results sync करने, feature flag segments द्वारा campaigns को target करने, और A/B test data एवं audience insights के साथ marketing automations को समृद्ध करने के लिए Tajo के माध्यम से Optimizely Feature Experimentation को Brevo से कनेक्ट करें।

अवलोकन

PropertyValue
PlatformOptimizely
CategoryExperimentation (Custom)
Setup ComplexityMedium
Official IntegrationNo
Data SyncedExperiments, Audiences, Events, Feature Flags
Auth MethodPersonal Access Token / OAuth 2.0

विशेषताएं

  • Experiment sync - A/B test variation assignments को Brevo contact attributes में push करें
  • Audience targeting - Brevo campaign segmentation के लिए Optimizely audiences का उपयोग करें
  • Conversion tracking - Optimizely events को ट्रैक करें और Brevo event tracking से map करें
  • Feature flag sync - enabled feature flags द्वारा contacts segment करें
  • Results reporting - post-analysis marketing campaigns के लिए experiment results sync करें
  • Multi-project support - एक single Tajo instance से कई Optimizely projects कनेक्ट करें

पूर्वावश्यकताएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:

  1. एक Optimizely Feature Experimentation account
  2. Optimizely App Settings से एक Personal Access Token
  3. आपके Optimizely environment के लिए एक SDK key
  4. API access वाला एक Brevo account
  5. connector permissions वाला एक Tajo account

प्रमाणीकरण

Personal Access Token

Terminal window
# https://app.optimizely.com/v2/accountsettings/tokens पर generate करें
export OPTIMIZELY_ACCESS_TOKEN=your_personal_access_token
export OPTIMIZELY_SDK_KEY=your_sdk_key
export TAJO_API_KEY=your_tajo_api_key
export BREVO_API_KEY=your_brevo_api_key
// सभी REST API requests Bearer token auth का उपयोग करते हैं
const headers = {
'Authorization': `Bearer ${process.env.OPTIMIZELY_ACCESS_TOKEN}`,
'Content-Type': 'application/json'
};

SDK Authentication

// feature flag evaluation के लिए, SDK का उपयोग करें
const optimizelySDK = require('@optimizely/optimizely-sdk');
const optimizelyClient = optimizelySDK.createInstance({
sdkKey: process.env.OPTIMIZELY_SDK_KEY,
datafileOptions: {
autoUpdate: true,
updateInterval: 60000 // 1 minute
}
});
await optimizelyClient.onReady();

कॉन्फ़िगरेशन

बेसिक सेटअप

connectors:
optimizely:
enabled: true
access_token: "${OPTIMIZELY_ACCESS_TOKEN}"
sdk_key: "${OPTIMIZELY_SDK_KEY}"
project_id: "12345678"
sync:
experiments: true
audiences: true
events: true
feature_flags: true
schedule: "0 */2 * * *" # हर 2 घंटे में
mapping:
experiment_variation: EXPERIMENT_VARIATION
feature_flags: ENABLED_FEATURES
audience_segments: OPT_SEGMENTS

Field Mapping

field_mapping:
user_id: email
experiment_key: EXPERIMENT_NAME
variation_key: VARIATION_NAME
feature_key: FEATURE_FLAG
enabled: FEATURE_ENABLED
audience_name: AUDIENCE_SEGMENT
decision_timestamp: EXPERIMENT_DATE

API Endpoints

EndpointMethodविवरण
https://api.optimizely.com/v2/projectsGETprojects list करें
https://api.optimizely.com/v2/experimentsGETexperiments list करें
https://api.optimizely.com/v2/experiments/{id}GETexperiment विवरण प्राप्त करें
https://api.optimizely.com/v2/experiments/{id}/resultsGETexperiment results प्राप्त करें
https://api.optimizely.com/v2/featuresGETfeature flags list करें
https://api.optimizely.com/v2/features/{id}GETfeature flag प्राप्त करें
https://api.optimizely.com/v2/audiencesGETaudiences list करें
https://api.optimizely.com/v2/eventsGETtracked events list करें
https://logx.optimizely.com/v1/eventsPOSTevents ट्रैक करें (SDK endpoint)

कोड उदाहरण

कनेक्टर शुरू करें

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
await tajo.connectors.connect('optimizely', {
accessToken: process.env.OPTIMIZELY_ACCESS_TOKEN,
sdkKey: process.env.OPTIMIZELY_SDK_KEY,
projectId: '12345678'
});

Experiment Decisions को Brevo से Sync करें

// experiment decisions ट्रैक करें और Brevo से sync करें
const optimizelyClient = optimizelySDK.createInstance({
sdkKey: process.env.OPTIMIZELY_SDK_KEY
});
await optimizelyClient.onReady();
// decision notification listener register करें
optimizelyClient.notificationCenter.addNotificationListener(
optimizelySDK.enums.NOTIFICATION_TYPES.DECISION,
async (decisionObject) => {
const { type, userId, attributes, decisionInfo } = decisionObject;
if (type === 'feature' || type === 'ab-test') {
const email = attributes.email;
if (email) {
await tajo.contacts.update(email, {
attributes: {
EXPERIMENT_NAME: decisionInfo.experimentKey || decisionInfo.featureKey,
VARIATION_NAME: decisionInfo.variationKey,
FEATURE_ENABLED: decisionInfo.featureEnabled || false,
EXPERIMENT_DATE: new Date().toISOString()
}
});
}
}
}
);

Experiment Results Sync करें

// experiment results लाएं और winning segments sync करें
const resultsResponse = await fetch(
`https://api.optimizely.com/v2/experiments/${experimentId}/results`,
{
headers: {
'Authorization': `Bearer ${process.env.OPTIMIZELY_ACCESS_TOKEN}`
}
}
);
const results = await resultsResponse.json();
// variations process करें और contact segments अपडेट करें
for (const variation of results.metrics) {
const isWinner = variation.is_improvement && variation.statistical_significance >= 0.95;
if (isWinner) {
// winning variation में users के लिए Brevo segment बनाएं
console.log(`Winning variation: ${variation.variation_name}`);
}
}

Feature Flag-आधारित Segmentation

// user segmentation के लिए feature flags का मूल्यांकन करें
async function syncFeatureFlags(userEmail, userId) {
const features = ['new_checkout', 'loyalty_program', 'ai_recommendations'];
const enabledFeatures = [];
for (const feature of features) {
const user = optimizelyClient.createUserContext(userId, {
email: userEmail
});
const decision = user.decide(feature);
if (decision.enabled) {
enabledFeatures.push(feature);
}
}
await tajo.contacts.update(userEmail, {
attributes: {
ENABLED_FEATURES: enabledFeatures.join(', '),
FEATURE_FLAGS_SYNCED: new Date().toISOString()
}
});
}

Rate Limits

EndpointLimitनोट्स
REST API50 req/minप्रति personal access token
Results API10 req/minअधिक latency, भारी queries
SDK Event Dispatch10,000 events/batchSDK event processor के माध्यम से
Datafile CDNअसीमितauto-updates के साथ cached

Results API Latency

Experiment Results API बड़े datasets को process करता है और respond करने में 30+ सेकंड ले सकता है। अपने application को block होने से बचाने के लिए async polling या caching का उपयोग करें।

समस्या निवारण

समस्याकारणसमाधान
401 UnauthorizedToken expired/invalidPersonal Access Token पुनः generate करें
SDK ready नहींDatafile load नहीं हुआonReady() promise के resolve होने की प्रतीक्षा करें
कोई decisions log नहींNotification register नहींdecisions करने से पहले listener register करें
पुराने feature flagsDatafile cacheauto-refresh के लिए updateInterval सेट करें
गायब resultsExperiment शुरू नहींसत्यापित करें कि experiment status “running” है

Debug Mode

connectors:
optimizely:
debug: true
log_level: verbose
log_decisions: true
log_events: true

सर्वोत्तम प्रथाएं

  1. Decisions के लिए SDK का उपयोग करें - real-time flag evaluation के लिए SDK, management के लिए REST API का उपयोग करें
  2. Event batching लागू करें - network overhead कम करने के लिए SDK events को batch करें
  3. Datafile cache करें - उपयुक्त intervals के साथ auto-update enable करें
  4. Winning variations sync करें - experiments समाप्त होने के बाद contact segments अपडेट करें
  5. Targeting के लिए attributes का उपयोग करें - audience matching के लिए email और user attributes pass करें
  6. Experiment status monitor करें - केवल running या concluded experiments से data sync करें

सुरक्षा

  • Personal Access Tokens - REST API के लिए Bearer token authentication
  • SDK key isolation - प्रति environment (dev, staging, prod) अलग SDK keys
  • Server-side evaluation - exposure रोकने के लिए feature flags को server-side मूल्यांकन करें
  • Token rotation - Personal Access Tokens को समय-समय पर rotate करें
  • Minimal permissions - जब write access की आवश्यकता न हो तो read-only tokens का उपयोग करें
  • Encrypted transport - सभी API और SDK communications के लिए TLS 1.2+

संबंधित संसाधन

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
AI Assistant

Hi! Ask me anything about the docs.