Skip to main content

🌐 Subdomain Integration

This guide explains how to set up a subdomain for your Magfi Ad Network integration for improved branding and performance.

Introduction

If you want to integrate Magfi Ad Network to monetize your Telegram Mini Apps, MagfiAds offers a simple and effective solution. This solution involves serving your Mini App via a dedicated subdomain under our ad network-approved domain, magfiads.com. This enables your application to receive programmatic ads directly from platforms like Google, Amazon etc.

How it Works

Programmatic ad networks require that the domains serving ads meet specific standards and are approved. magfiads.com is such an approved domain.

The integration process typically involves:

  1. You provide the static IP address of the server hosting your Mini App.
  2. We create a unique subdomain for you (e.g., your-app.magfiads.com) and configure a DNS A record pointing to your server's IP address.
  3. You set this new subdomain URL as the launch URL for your Mini App via BotFather in Telegram.

This method makes your Mini App appear as served from magfiads.com, enabling ad eligibility. (See below for specific Vercel instructions).

Implementation Steps

  1. Agree on Subdomain & Provide Configuration Details:

    • Contact the MagfiAds team to agree on a unique subdomain name (e.g., your-app.magfiads.com).
    • If using a standard server: Provide the static IPv4 address of the server hosting your Mini App.
    • If using Vercel: Follow the "Specific Steps for Vercel Users" below first to get the required DNS value, then provide that value to us.
  2. MagfiAds DNS Configuration: Based on the information you provide (IP address or Vercel DNS value), we will configure the necessary DNS record (A or CNAME) for your subdomain (your-app.magfiads.com). We will notify you once this is done.

  3. Update the URL in BotFather:

    • You need to update your Mini App URL through BotFather.
    • You can find detailed steps for this process on the Updating Mini App URL page.

Specific Steps for Vercel Users

If your Mini App is hosted on Vercel, the process to get the correct DNS configuration value differs slightly:

  1. Add Domain in Vercel: After agreeing on the subdomain name (your-app.magfiads.com) with us, go to your Vercel Project Dashboard > Settings > Domains.
  2. Enter the exact subdomain (your-app.magfiads.com) and add it.
  3. Get Vercel DNS Configuration: Vercel will display the required DNS record configuration needed to point the subdomain to your Vercel project. This is typically an A record pointing to a specific Vercel IP address (e.g., 76.76.21.21) or sometimes a CNAME record.
    • Important: Always use the exact value provided by Vercel in your dashboard, as their required configurations can change.
  4. Provide DNS Value to MagfiAds: Provide the exact DNS record value (the IP address or CNAME target shown by Vercel) to the MagfiAds team. This replaces providing your own server IP in Step 1 of the main Implementation Steps.
  5. Proceed: Once you provide this value, we will perform Step 2 (MagfiAds DNS Configuration). After we confirm the setup, Vercel should automatically verify the domain, and you can proceed with Step 3 (Update the URL in BotFather).

Key Advantages and Considerations

  • Simplicity: Minimal changes required on your end, primarily updating the BotFather URL (and adding the domain in Vercel if applicable).
  • Isolated Impact: This URL change only affects how your Mini App is launched from within Telegram. It absolutely does not affect your primary domain, main website deployment, APIs, or other services.
  • Easy Management: If your underlying hosting changes (e.g., Vercel IP updates), the process involves updating the DNS record via MagfiAds (or potentially just re-verifying in Vercel), usually without needing to change the BotFather URL again.
  • Ad Compatibility: Serving your app under an approved domain streamlines programmatic ad integration and unlocks your monetization potential.

Support

If you have any questions or need assistance during this integration process, please contact the MagfiAds support team: [Add Your Support Contact Information Here]