ابتدائی رسائی کی درخواست کریں

اپنا پہلا نام اور ای میل یا فون نمبر درج کریں۔ ہم Tajo تک رسائی کی تفصیلات کے ساتھ آپ سے رابطہ کریں گے۔

Tajo-Brevo انٹیگریشن گائیڈ

یہ جامع گائیڈ آپ کو مرحلہ وار بتاتی ہے کہ اپنے Tajo لائلٹی پلیٹ فارم کو Brevo کے ساتھ کیسے جوڑا جائے تاکہ گاہکوں کی مصروفیت کی طاقتور، خودکار مہمات بنائی جا سکیں۔

جائزہ

Tajo-Brevo انٹیگریشن آپ کو یہ سہولت دیتی ہے:

  • دونوں پلیٹ فارمز کے درمیان حقیقی وقت میں گاہک کا ڈیٹا سنک کریں
  • گاہک کے رویے کی بنیاد پر لائلٹی مہمات خودکار بنائیں
  • ای میل، ایس ایم ایس اور واٹس ایپ پر مصروفیت کا سراغ رکھیں
  • لائلٹی درجے اور خریداری کے رویے کے مطابق گاہکوں کو سیگمنٹ کریں
  • اہم لائلٹی ایونٹس پر ذاتی نوعیت کے پیغامات چلائیں

پیشگی شرائط

انٹیگریشن شروع کرنے سے پہلے یقینی بنائیں کہ آپ کے پاس یہ موجود ہیں:

  • لائلٹی پروگرام کنفیگر شدہ Tajo اکاؤنٹ
  • API رسائی کے ساتھ Brevo اکاؤنٹ
  • دونوں پلیٹ فارمز کے لیے درست API کیز
  • حقیقی وقت کے سنک کے لیے ترتیب دیے گئے ویب ہک اینڈ پوائنٹس
  • محفوظ ڈیٹا منتقلی کے لیے SSL سرٹیفکیٹ

مرحلہ 1: تصدیق کا سیٹ اپ

Brevo API کی بنائیں

  1. اپنے Brevo اکاؤنٹ میں سائن ان کریں
  2. Account & Plan > API Keys پر جائیں
  3. Generate a new API key پر کلک کریں
  4. اس کا نام “Tajo Integration” رکھیں
  5. کی کاپی کر کے محفوظ طریقے سے رکھیں
Terminal window
# Store in environment variables
export BREVO_API_KEY="xkeysib-your-api-key-here"
export TAJO_WEBHOOK_SECRET="your-webhook-secret"

Tajo انٹیگریشن کنفیگر کریں

اپنے Tajo ڈیش بورڈ میں:

  1. Settings > Integrations پر جائیں
  2. فہرست سے Brevo منتخب کریں
  3. اپنی Brevo API کی درج کریں
  4. سنک کی سیٹنگز کنفیگر کریں
{
"brevo_api_key": "xkeysib-your-api-key-here",
"sync_frequency": "real-time",
"sync_contacts": true,
"sync_orders": true,
"sync_events": true,
"loyalty_attributes": [
"LOYALTY_POINTS",
"LOYALTY_TIER",
"TOTAL_SPENT",
"LAST_PURCHASE"
]
}

مرحلہ 2: گاہک کے ڈیٹا کی ہم آہنگی

رابطہ سنک کی کنفیگریشن

گاہک کا ڈیٹا تازہ رکھنے کے لیے خودکار رابطہ ہم آہنگی ترتیب دیں:

// Sync customer on registration
async function syncCustomerToBrevo(customer) {
const brevoData = {
email: customer.email,
attributes: {
FIRSTNAME: customer.firstName,
LASTNAME: customer.lastName,
PHONE: customer.phone,
LOYALTY_ID: customer.loyaltyId,
LOYALTY_POINTS: customer.points,
LOYALTY_TIER: customer.tier,
SIGNUP_DATE: customer.createdAt,
TOTAL_SPENT: customer.totalSpent,
PREFERRED_CATEGORIES: customer.categories,
BIRTHDAY: customer.birthday
},
listIds: [getListForTier(customer.tier)]
};
const response = await fetch('https://api.brevo.com/v3/contacts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': process.env.BREVO_API_KEY
},
body: JSON.stringify(brevoData)
});
return response.json();
}

خریداری کے ایونٹ کا سنک

لائلٹی مہمات چلانے کے لیے خریداریوں کو خودکار طور پر سنک کریں:

// Sync order completion
async function syncOrderToBrevo(order, customer) {
// Create order in Brevo
const orderData = {
id: order.id,
email: customer.email,
products: order.items.map(item => ({
id: item.productId,
name: item.name,
quantity: item.quantity,
price: item.price,
category: item.category
})),
revenue: order.total,
date: order.createdAt
};
await fetch('https://api.brevo.com/v3/ecommerce/orders', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': process.env.BREVO_API_KEY
},
body: JSON.stringify(orderData)
});
// Create loyalty event
const eventData = {
email: customer.email,
event: 'Purchase Completed',
properties: {
order_id: order.id,
amount: order.total,
points_earned: order.pointsEarned,
loyalty_tier: customer.tier,
tier_upgraded: order.tierUpgraded,
products: order.items.map(i => i.name).join(', ')
}
};
await fetch('https://api.brevo.com/v3/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': process.env.BREVO_API_KEY
},
body: JSON.stringify(eventData)
});
}

مرحلہ 3: خودکار مہم کا سیٹ اپ

نئے گاہکوں کے لیے خوش آمدیدی مہم

نئے لائلٹی ممبران کے لیے ایک خودکار خوش آمدیدی سلسلہ بنائیں:

{
"campaign_name": "Tajo Loyalty Welcome Series",
"trigger": {
"event": "Contact Created",
"conditions": {
"LOYALTY_ID": "exists",
"SIGNUP_DATE": "today"
}
},
"emails": [
{
"delay": "immediate",
"template_id": 101,
"subject": "Welcome to Tajo Loyalty! Here's your {{params.welcome_bonus}} points bonus",
"params": {
"welcome_bonus": "500",
"loyalty_tier": "Bronze",
"next_tier_points": "1000"
}
},
{
"delay": "3 days",
"template_id": 102,
"subject": "Don't forget to use your {{params.welcome_bonus}} bonus points!"
},
{
"delay": "1 week",
"template_id": 103,
"subject": "Here's how to earn points faster with Tajo"
}
]
}

درجہ بڑھنے کی مہم

درجے میں اضافے کا خودکار طور پر جشن منائیں:

// Webhook handler for tier upgrades
app.post('/webhook/tier-upgrade', (req, res) => {
const { customer, previousTier, newTier } = req.body;
const campaignData = {
email: customer.email,
template_id: getTierUpgradeTemplate(newTier),
params: {
customer_name: customer.firstName,
new_tier: newTier,
previous_tier: previousTier,
new_benefits: getTierBenefits(newTier),
points_balance: customer.points
}
};
// Send congratulations email
sendBrevoEmail(campaignData);
// Add to tier-specific list
addToBrevoList(customer.email, getTierListId(newTier));
res.status(200).json({ success: true });
});

مرحلہ 4: لائلٹی ایونٹس کا سراغ

سراغ رکھنے کے لیے اہم ایونٹس

ان بنیادی لائلٹی ایونٹس کے لیے ٹریکنگ ترتیب دیں:

const loyaltyEvents = {
// Account Events
'Account Created': {
properties: ['signup_source', 'referral_code', 'welcome_bonus']
},
'Profile Updated': {
properties: ['updated_fields', 'marketing_consent']
},
// Purchase Events
'Purchase Completed': {
properties: ['order_total', 'points_earned', 'loyalty_tier', 'products']
},
'Product Returned': {
properties: ['return_reason', 'points_deducted', 'refund_amount']
},
// Loyalty Events
'Points Earned': {
properties: ['points_amount', 'earning_reason', 'total_balance']
},
'Points Redeemed': {
properties: ['points_used', 'reward_type', 'remaining_balance']
},
'Tier Upgraded': {
properties: ['previous_tier', 'new_tier', 'upgrade_benefits']
},
// Engagement Events
'Email Opened': {
properties: ['campaign_type', 'subject_line', 'device']
},
'Reward Browsed': {
properties: ['reward_category', 'reward_name', 'points_required']
},
'Referral Made': {
properties: ['referral_method', 'referee_email', 'referral_bonus']
}
};

ایونٹ ٹریکنگ کا نفاذ

class TajoBrevoEventTracker {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = 'https://api.brevo.com/v3';
}
async trackEvent(customerEmail, eventName, properties = {}) {
const eventData = {
email: customerEmail,
event: eventName,
properties: {
timestamp: new Date().toISOString(),
source: 'tajo_platform',
...properties
}
};
try {
const response = await fetch(`${this.baseUrl}/events`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': this.apiKey
},
body: JSON.stringify(eventData)
});
if (!response.ok) {
throw new Error(`Event tracking failed: ${response.statusText}`);
}
return await response.json();
} catch (error) {
console.error('Brevo event tracking error:', error);
throw error;
}
}
// Convenience methods for common events
async trackPurchase(customer, order) {
return this.trackEvent(customer.email, 'Purchase Completed', {
order_id: order.id,
order_total: order.total,
currency: order.currency,
points_earned: order.pointsEarned,
loyalty_tier: customer.tier,
items_count: order.items.length,
first_purchase: customer.orderCount === 1
});
}
async trackTierUpgrade(customer, previousTier) {
return this.trackEvent(customer.email, 'Tier Upgraded', {
previous_tier: previousTier,
new_tier: customer.tier,
points_balance: customer.points,
benefits_unlocked: getTierBenefits(customer.tier),
upgrade_date: new Date().toISOString()
});
}
}

مرحلہ 5: سیگمنٹیشن کی حکمت عملی

گاہکوں کے سیگمنٹس

ذاتی نوعیت کی مہمات کے لیے Brevo میں ہدف بند سیگمنٹس بنائیں:

const loyaltySegments = [
// Tier-based segments
{
name: "Bronze Members",
conditions: { LOYALTY_TIER: "Bronze" },
campaigns: ["tier_upgrade_promotion", "engagement_boost"]
},
{
name: "Silver Members",
conditions: { LOYALTY_TIER: "Silver" },
campaigns: ["premium_offers", "early_access"]
},
{
name: "Gold Members",
conditions: { LOYALTY_TIER: "Gold" },
campaigns: ["vip_treatment", "exclusive_rewards"]
},
{
name: "Platinum Members",
conditions: { LOYALTY_TIER: "Platinum" },
campaigns: ["luxury_experiences", "personal_offers"]
},
// Behavior-based segments
{
name: "High Spenders",
conditions: { TOTAL_SPENT: ">1000" },
campaigns: ["luxury_catalog", "big_spender_rewards"]
},
{
name: "Frequent Shoppers",
conditions: { PURCHASE_FREQUENCY: "weekly" },
campaigns: ["convenience_offers", "bulk_discounts"]
},
{
name: "At-Risk Customers",
conditions: { LAST_PURCHASE: ">90 days" },
campaigns: ["win_back", "special_incentives"]
},
{
name: "Birthday Month",
conditions: { BIRTHDAY: "this_month" },
campaigns: ["birthday_specials", "bonus_points"]
}
];

مرحلہ 6: جانچ اور نگرانی

انٹیگریشن جانچ کی فہرست

  • رابطہ سنک: نئے گاہک Brevo میں ظاہر ہوتے ہیں
  • آرڈر سنک: خریداریاں ایونٹس کو درست طور پر چلاتی ہیں
  • ایونٹ ٹریکنگ: تمام لائلٹی ایونٹس ریکارڈ ہوتے ہیں
  • مہم کے ٹریگرز: خودکار ای میلز درست طریقے سے بھیجی جاتی ہیں
  • سیگمنٹیشن: گاہک فہرستوں کے درمیان درست طور پر منتقل ہوتے ہیں
  • ویب ہک ڈیلیوری: حقیقی وقت کا سنک بھروسے کے ساتھ کام کرتا ہے

نگرانی کا سیٹ اپ

// Health check endpoint
app.get('/integration/health', async (req, res) => {
const checks = {
brevo_api: await checkBrevoConnection(),
webhook_delivery: await checkWebhookDelivery(),
event_tracking: await checkEventTracking(),
campaign_triggers: await checkCampaignTriggers()
};
const allHealthy = Object.values(checks).every(check => check.status === 'ok');
res.status(allHealthy ? 200 : 503).json({
status: allHealthy ? 'healthy' : 'degraded',
checks,
timestamp: new Date().toISOString()
});
});

عام مسائل کا حل

API ریٹ حدود

Brevo میں ریٹ حدود ہیں، اس لیے دوبارہ کوشش کی منطق نافذ کریں:

async function makeBrevoRequest(url, options, retries = 3) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 60;
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
return makeBrevoRequest(url, options, retries - 1);
}
return response;
} catch (error) {
if (retries > 0) {
await new Promise(resolve => setTimeout(resolve, 5000));
return makeBrevoRequest(url, options, retries - 1);
}
throw error;
}
}

ڈیٹا سنک کے مسائل

سنک کے تصادم پر نظر رکھیں اور انہیں حل کریں:

// Sync conflict resolution
async function resolveSyncConflict(tajoData, brevoData) {
// Use most recent timestamp as source of truth
const tajoUpdated = new Date(tajoData.updatedAt);
const brevoUpdated = new Date(brevoData.modifiedAt);
if (tajoUpdated > brevoUpdated) {
// Update Brevo with Tajo data
await updateBrevoContact(brevoData.id, tajoData);
} else {
// Update Tajo with Brevo data
await updateTajoCustomer(tajoData.id, brevoData);
}
}

اگلے اقدامات

  1. حقیقی وقت کے سنک کے لیے ویب ہکس ترتیب دیں
  2. لائلٹی مہمات کے لیے ای میل ٹیمپلیٹس بنائیں
  3. فوری اطلاعات کے لیے ایس ایم ایس آٹومیشن کنفیگر کریں
  4. کارکردگی کا سراغ رکھنے کے لیے اینالٹکس ترتیب دیں

سپورٹ اور وسائل

ابتدائی رسائی کی درخواست کریں

اپنا پہلا نام اور ای میل یا فون نمبر درج کریں۔ ہم Tajo تک رسائی کی تفصیلات کے ساتھ آپ سے رابطہ کریں گے۔

خودکار شناخت
AI معاون

السلام علیکم! دستاویزات کے بارے میں کچھ بھی پوچھیں۔