Skip links

یکپارچه سازی و اتصال اپلیکیشن Mobile App (S2S Direct) Integration

Skip to main content
چاپ

یکپارچه سازی و اتصال اپلیکیشن Mobile App (S2S Direct) Integration

عناوین و مراحل

Mobile App (S2S Direct) چیست؟

اپلیکیشن موبایل (S2S Direct) برای اپلیکیشن‌های iOS/Android (یا هر ادغامی که در آن بازدیدکننده روی لینکی در مرورگر کلیک نمی‌کند) است. تبدیل‌ها با استفاده از affiliate_id و campaign_id به جای click_token گزارش می‌شوند. اپلیکیشن شما وقتی کاربراپلیکیشن را باز می‌کند (مثلاً از طریق لینک عمیق)، معرف وابسته را ثبت می‌کند، سپس وقتی فروش یا رزروی اتفاق می‌افتد، سرور شما با آن شناسه‌ها و جزئیات سفارش، POSTهایی را به نقطه پایانی S2S ارسال می‌کند. نیازی به click_token یا کوکی‌ها نیست.

کجا آن را تنظیم یا Configure نمایید؟

تمامی روش‌های یکپارچه‌سازی در فرم کمپین و در زبانه «تنظیمات یکپارچه‌سازی» (Integration Setup) قرار دارند. از بخش مدیریت برنامه AffiliatePro استفاده کنید.

چگونه Form را باز کرده و Mobile App را برگزینیم؟

۱. وارد بخش مدیریت برنامه AffiliatePro شوید.

۲. در نوار بالا، منوی کشویی بازاریابی را باز کنید → روی کمپین‌ها کلیک کنید.

۳. در صفحه کمپین‌ها، چهار کارت نوع کمپین خواهید دید: کمپین بنری، کمپین متنی، کمپین لینکی، کمپین ویدیویی. برای ایجاد یک کمپین، روی هر کارت روی «ایجاد جدید» کلیک کنید، یا برای باز کردن آن روی دکمه «ویرایش» روی یک کمپین موجود کلیک کنید.

۴. در برگه «تنظیمات عمومی»، نام کمپین را وارد کنید و نوع ابزار را تنظیم کنید (ادغام فروش برای ردیابی موبایل مبتنی بر خرید معمول است). تنظیمات دیگر را در صورت نیاز اضافه کنید.

۵. روی برگه «تنظیمات ادغام» (آیکون افزونه) کلیک کنید.

۶. در زیر «روش ادغام خود را انتخاب کنید»، روی کارت «برنامه موبایل (S2S Direct)» کلیک کنید.

وابستگی حیاتی: ابتدا ذخیره کنید

کلید API، آدرس (URL) اندپوینت S2S، جدول پارامترهای حالت مستقیم (Direct Mode)، نمونه‌های cURL و اندپوینت ثبت کلیک (Register Click Endpoint)، تنها پس از یک بار ذخیره کردن کمپین نمایش داده می‌شوند. تا پیش از ذخیره‌سازی، فرم این پیام را نشان می‌دهد: «ابتدا این کمپین را ذخیره کنید. کلید API و مستندات اندپوینت پس از ذخیره‌سازی در اینجا ظاهر خواهند شد.»

روی گزینه «ذخیره» (Save) کلیک کنید (و نه «ذخیره و بستن» یا Save & Close) تا بتوانید بلافاصله کلید API و آدرس‌های اندپوینتِ ظاهرشده را کپی کنید.

نحوه عملکرد Direct Mode 

۱. هنگامی که کاربر اپلیکیشن را از طریق لینک ارجاع (مانند دیپ‌لینک) باز می‌کند، اپلیکیشن شناسه بازاریاب ارجاع‌دهنده را ثبت می‌کند.

۲. با انجام فروش یا رزرو، سرور اپلیکیشن یک درخواست POST به اندپوینت S2S ارسال می‌کند که حاوی affiliate_id، campaign_id و جزئیات سفارش است.

۳. سیستم، بازاریاب را شناسایی کرده، کمیسیون را محاسبه و به‌صورت خودکار توزیع می‌کند؛ بدون اینکه نیازی به click_token یا کوکی باشد.

 Form پس از ذخیره چه نمایش میدهد؟

کلید API — آن را با استفاده از دکمه «Copy» کپی کنید و در هر درخواست ارسال نمایید.

آدرس (Endpoint) مربوط به S2S — داده‌های تبدیل (conversion) را به این آدرس ارسال (POST) کنید. آدرس دقیق در فرم نمایش داده شده است و از الگوی …/integration/s2sConvert پیروی می‌کند (این همان endpoint مربوط به S2S API است، اما با پارامترهای متفاوت).

جدول پارامترهای حالت مستقیم (Direct Mode) — شامل: api_key، affiliate_id، campaign_id، order_id، order_total و order_currency. فرم مذکور، جدول کامل مستندات و یک نمونه دستور cURL (با فرمت JSON) را نمایش می‌دهد که در آن کلید API، شناسه کمپین (campaign ID) و آدرس endpoint شما از پیش درج شده‌اند.

آدرس (Endpoint) ثبت کلیک — اختیاری. اگر اپلیکیشن شما قصد دارد پیش از مرحله تبدیل (مثلاً هنگام باز کردن اپلیکیشن توسط کاربر)، یک رویداد ارجاع (referral event) را ثبت کند، از این گزینه استفاده نمایید. این آدرس از الگوی…/integration/s2sRegisterClick پیروی می‌کند. فرم مربوطه، آدرس دقیق و یک نمونه بدنه درخواست POST شامل پارامترهای api_key، campaign_id، affiliate_id و visitor_id را نمایش می‌دهد.

نمونه های Response

  • Success — {"status":"success","message":"S2S conversion recorded successfully"}
  • Duplicate — {"status":"duplicate","message":"Order already recorded"}
  • Error — e.g. {"status":"error","message":"Invalid API key"}

دسترسی فوری از Campaigns List

در جدول کمپین‌ها، کمپین‌های اپلیکیشن موبایل در ستون «وضعیت یکپارچه‌سازی» (Integration Status) دارای نشان «Mobile / S2S Direct» هستند. برای باز کردن پنجره تنظیمات موبایل و مشاهده جزئیات کلید API و اندپوینت (بدون نیاز به تکمیل فرم کامل)،روی دکمه‌ای که آیکون تلفن دارد و در کنار این نشان قرار گرفته است، کلیک کنید.

زمانی که نمی‌توانید به کلیک در مرورگر یا click_token تکیه کنید — برای مثال در مواردی همچون خریدهای درون‌برنامه‌ای، نصب اپلیکیشن، یا گزارش‌دهی سرور-به-سرور (S2S) از سمت بک‌اند که در آن تغییر مسیر (ریدایرکت) مرورگر رخ نمی‌دهد — از اپلیکیشنموبایل (S2S Direct) استفاده کنید.

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||  ENGLISH   ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

What Is Mobile App (S2S Direct)?

Mobile App (S2S Direct) is for iOS/Android apps (or any integration where the visitor does not click a link in a browser). Conversions are reported using affiliate_id and campaign_id instead of click_token. Your app captures the referring affiliate when the user opens the app (e.g. via deep link), then when a sale or booking happens your server POSTs to the S2S endpoint with those IDs and order details. No click_token or cookies needed.

Where You Configure It

All integration methods are in the campaign form, under the Integration Setup tab. Use the AffiliatePro application admin.

How to Open the Form and Choose Mobile App

Log in to the AffiliatePro application admin.In the top bar, open the Marketing dropdown → click Campaigns.On the Campaigns page you will see four campaign type cards: Banner Campaign, Text Campaign, Link Campaign, Video Campaign. Click Create New on any card to create a campaign, or click the Edit button on an existing campaign to open it.In the General Settings tab, fill in the Campaign Name and set the Tool Type (Sale Integration is typical for purchase-based mobile tracking). Add other settings as needed.Click the Integration Setup tab (plug icon).Under Choose Your Integration Method, click the Mobile App (S2S Direct) card.

Critical Dependency: Save First

The API key, S2S Endpoint URL, Direct Mode parameter table, example cURLs, and Register Click Endpoint are only shown after you save the campaign at least once. Until saved, the form shows: “Save this campaign first. Your API key and endpoint documentation will appear here after saving.”Click Save (stays on the form) — not Save & Close — so you can immediately copy the API key and endpoint URLs that appear.

How Direct Mode Works

The app captures the referring affiliate’s ID when a user opens it via a referral link (e.g. deep link).When a sale or booking happens, the app’s server sends a POST request to the S2S endpoint with affiliate_idcampaign_id, and order details.The system identifies the affiliate, calculates commission, and distributes it automatically — no click_token or cookies needed.

What the Form Shows After Saving

API Key — copy it with the Copy button. Send with every request.S2S Endpoint URL — POST conversion data here. The exact URL is shown in the form; it follows the pattern .../integration/s2sConvert (same endpoint as S2S API, but with different parameters).Direct Mode Parameters table — api_keyaffiliate_idcampaign_idorder_idorder_totalorder_currency. The form shows the full documentation table and a JSON example cURL with your actual API key, campaign ID, and endpoint pre-filled.Register Click Endpoint — optional. Use this if your app wants to register a referral event before the conversion (e.g. when the user opens the app). The endpoint follows the pattern .../integration/s2sRegisterClick. The form shows the exact URL and an example POST body with api_keycampaign_idaffiliate_idvisitor_id.

Response Examples

Success — {"status":"success","message":"S2S conversion recorded successfully"}Duplicate — {"status":"duplicate","message":"Order already recorded"}Error — e.g. {"status":"error","message":"Invalid API key"}

Quick Access from the Campaigns List

In the Campaigns table, Mobile App campaigns show a Mobile / S2S Direct badge in the Integration Status column. Click the phone icon button next to the badge to open the Mobile setup modal and view API key and endpoint details without entering the full form.Use Mobile App (S2S Direct) when you cannot rely on a browser click or click_token — e.g. in-app purchases, app installs, or server-to-server reporting from a backend where no browser redirect happens.

Leave a comment