Custom Endpoints

Proxy Mobana through your own domain for cleaner URLs and ad-blocker bypass.

Why Use Custom Endpoints?#

  • Cleaner campaign URLs: yourdomain.com/da/link looks better than a1b2c3d4.mobana.ai/link
  • Ad-blocker bypass: Some ad blockers block third-party attribution domains. Your own domain is less likely to be blocked.
  • Easier migration: If you ever switch attribution providers, your campaign URLs don't change.
  • Brand consistency: Keep all URLs under your brand's domain.

How It Works#

  1. Choose a path on your domain (e.g., yourdomain.com/da)
  2. Set up a reverse proxy that forwards the required endpoints to YOUR_APP_ID.mobana.ai
  3. Enter your custom endpoint URL in App Settings → Integration and save
  4. Configure the SDK to use your custom endpoint
  5. Use your custom URL when sharing Mobana links

The path you choose (e.g., /da) is configurable — use any path that fits your domain structure. The App Settings panel generates the correct proxy config automatically once you enter your endpoint URL.

Smart links need .well-known files

If you want Universal Link / App Link interception (see the Deeplinks guide), your proxy must also forward /.well-known/apple-app-site-association and /.well-known/assetlinks.json from your domain to YOUR_APP_ID.mobana.ai. The configs below already include this — just make sure they're served at the host root, not under your /da prefix.

Proxy Configuration#

Choose one of the following methods to route requests from your domain to Mobana. Replace YOUR_APP_ID with your actual App ID and /da with your chosen path.

Option 1: Cloudflare DNS (CNAME)

The simplest option if your domain is on Cloudflare. Point a subdomain to Mobana via a proxied CNAME record — no server configuration required.

Type:CNAME
Name:da(or any subdomain)
Target:YOUR_APP_ID.mobana.ai
Proxy:Enabled (orange cloud)

Make sure the Cloudflare proxy is enabled (orange cloud icon), not DNS-only (grey). Cloudflare handles SSL automatically when proxy is enabled.

This method requires a dedicated subdomain (e.g., da.yourdomain.com). If you need a path-based endpoint like yourdomain.com/da, use the reverse proxy option below instead.

Option 2: Reverse Proxy

Route Mobana traffic through your existing web server. Unlike the Cloudflare CNAME approach, a reverse proxy works on a path-based endpoint (e.g., yourdomain.com/da) — no dedicated subdomain required. It also gives you full control over routing rules, headers, and logging, and works with any DNS provider.

Option 2a: nginx

Add the following block to your nginx server configuration. Only the specific Mobana endpoints are forwarded — all other traffic on your domain is unaffected.

nginx.conf
location ~ ^(/da/(redirect|deeplink(/(record|probe))?|find|ping|conversion|activity|flows.*)|/\.well-known/(apple-app-site-association|assetlinks\.json))$ {
  # Strip the /da prefix; .well-known stays at root (no-op rewrite)
  rewrite ^/da/(.*)$ /$1 break;
  rewrite ^(/\.well-known/.*)$ $1 break;

  proxy_pass https://YOUR_APP_ID.mobana.ai;
  proxy_set_header Host YOUR_APP_ID.mobana.ai;
  proxy_set_header X-App-Key $http_x_app_key;
  proxy_set_header X-Original-CF-Connecting-IP $http_cf_connecting_ip;
  proxy_set_header X-Original-Remote-Addr $remote_addr;
  proxy_ssl_server_name on;
}
Option 2b: Apache
.htaccess / httpd.conf
# Enable required modules: mod_proxy, mod_proxy_http, mod_ssl, mod_rewrite, mod_headers
<IfModule mod_rewrite.c>
  RewriteEngine On

  # Mobana SDK / web endpoints under /da
  RewriteCond %{REQUEST_URI} ^/da/(redirect|deeplink(/(record|probe))?|find|ping|conversion|activity|flows.*)$
  RewriteRule ^/da/(.*)$ https://YOUR_APP_ID.mobana.ai/$1 [P,QSA,L]

  # .well-known files for Universal Links / App Links (must live at host root)
  RewriteRule ^/?\.well-known/(apple-app-site-association|assetlinks\.json)$ https://YOUR_APP_ID.mobana.ai/.well-known/$1 [P,L]
</IfModule>

ProxyPassReverse / https://YOUR_APP_ID.mobana.ai/

RequestHeader set Host "YOUR_APP_ID.mobana.ai"
RequestHeader set X-App-Key "%{HTTP_X_APP_KEY}s"
RequestHeader set X-Original-Remote-Addr "%{REMOTE_ADDR}s"

SSLProxyEngine On
IP Forwarding

The proxy must forward the client's real IP address. The nginx and Apache configs above include the correct headers (X-Original-Remote-Addr and X-Original-CF-Connecting-IP). This is critical for probabilistic attribution matching. The Cloudflare DNS approach handles this automatically.

SDK Configuration#

After saving your custom endpoint in App Settings, tell the SDK to use it:

App.tsx
// In your React Native app
Mobana.init({
  appId: 'YOUR_APP_ID',
  appKey: 'YOUR_APP_KEY',
  endpoint: 'https://yourdomain.com/da',  // Your custom endpoint
});

Campaign URLs#

Use your custom domain in campaign links:

Campaign URL
# Campaign URL using your custom domain
https://yourdomain.com/da/link
  ?utm_source=facebook
  &utm_campaign=summer_sale
  &data={"promo":"SUMMER20"}

Testing Your Setup#

Use the ping endpoint to verify your proxy is working correctly:

Terminal
curl https://yourdomain.com/da/ping

# Should return:
# {
#   "ok": true,
#   "appId": "YOUR_APP_ID",
#   "appValid": true,
#   "clientIp": "your.ip.address"
# }

You can also test directly from the Dashboard: go to App Settings → Integration, enter your custom endpoint URL, and click Test.

Troubleshooting#

IP Address Shows Proxy IP

If /ping shows your proxy server's IP instead of the client's IP, ensure your proxy is setting the X-Original-Remote-Addr header as shown in the configs above.

SSL/TLS Errors

Ensure your proxy supports TLS 1.2+ and has a valid SSL certificate. For nginx, make sure proxy_ssl_server_name on is set so SNI is sent correctly to mobana.ai.

404 on Proxy Routes

The proxy only forwards the specific endpoints Mobana uses under your path prefix: redirect, deeplink, deeplink/record, deeplink/probe, find, ping, conversion, activity, flows/* — plus the host-root files /.well-known/apple-app-site-association and /.well-known/assetlinks.json (required for Universal Links / App Links). Any other path will return a 404 from your own server.

Universal Links / App Links not opening the app

The OS fetches /.well-known/apple-app-site-association (iOS) and /.well-known/assetlinks.json (Android) from your domain to verify which app owns the URL. Both files must respond with Content-Type: application/json and HTTP 200 — the proxy block above handles this automatically. Test with curl https://yourdomain.com/.well-known/apple-app-site-association.

CORS Errors

The Mobana API handles CORS automatically. If you see CORS errors, check that your proxy isn't modifying or stripping CORS headers in the response.

502 Bad Gateway / Could Not Resolve Host

If nginx can't resolve YOUR_APP_ID.mobana.ai, add a resolver directive to your server block:

nginx.conf
resolver 8.8.8.8 valid=30s;
AI agents: for complete Mobana SDK & API documentation, get full context here or visit llms.txt