Skip to main content

InTarget — Meta Messenger Integration Guide

Overview

InTarget integrates with Meta's Messenger platform to link players from your product to their Facebook or Instagram accounts. Once matched, InTarget can send CRM messages directly to players via Messenger or Instagram DM.

Flow at a glance:

  1. Player sends any message to your bot (Facebook Page or Instagram account)

  2. Bot replies with a personalized login link containing a unique hash token

  3. Player opens the link and logs in on your product

  4. Your backend sends the hash + player ID to InTarget's match API

  5. Player is matched — InTarget can now send them CRM messages via Messenger / Instagram DM

Messaging window: Meta allows messaging users who have initiated contact within the last 24 hours. To maintain delivery reliability, send messages slightly more frequently than once per 24 hours.

What You Need to Provide to InTarget

Before the integration can go live, please share the following with the InTarget team:

Parameter

Description

pageId

Your Facebook Page ID

pageAccessToken

Page Access Token generated in Meta for Developers

loginUrl

Base URL of your product's login page

loginButtonTitle

Title text shown on the button card sent to the user

loginButtonText

Subtitle / body text shown below the button

Example format:

json

{
"pageId": "YOUR_PAGE_ID",
"pageAccessToken": "YOUR_PAGE_ACCESS_TOKEN",
"loginUrl": "https://yourcasino.com/login",
"loginButtonTitle": "Log in to continue",
"loginButtonText": "Click the button below to verify your account"
}

Facebook Messenger Setup

Step 1 — Create or Access Your Meta App

  1. Select your existing app, or create a new one linked to your Facebook Page

  2. Add the Messenger product to your app

Step 2 — Get Your Page ID

  1. Open the Page you would like to find the ID for.

  2. Click your Page name at the top.

  3. Click

    Transparency and privacy policy.

  4. You will find your Page ID below Page information for [Page name].

Step 3 — Generate a Page Access Token

  1. In Meta for Developers → your app → Messenger → Settings

  2. Under Access Tokens, select your Facebook Page

  3. Click Generate Token and copy the value

  4. Send it to InTarget along with your Page ID

Step 4 — Register the InTarget Webhook

In your app settings → Messenger → Webhooks, add:

Subscribe to the following events:

  • messages

  • messaging_postbacks

  • message_deliveries

  • message_reads

Instagram Direct Setup

Step 1 — Connect Instagram to Your Facebook Page

  1. Go to your Facebook Page → Settings → Instagram

  2. Connect your Instagram Business account to the Page

  3. In Meta for Developers, add Instagram to your app and enable Instagram Messaging

Step 2 — Get Your Page ID and Access Token

The Page ID and Page Access Token are tied to the Facebook Page that controls the Instagram account — follow the same steps as in the Facebook setup above.

Step 3 — Register the InTarget Webhook

In your app settings → Instagram → Webhooks, add:

Subscribe to the following events:

  • messages

  • messaging_postbacks

  • message_deliveries

  • message_reads

Player Matching Flow (Backend Integration)

When a player clicks the login link sent by the bot, the URL will contain a unique hash:

https://yourcasino.com/login?hash=<unique_hash>&utm_source=InTarget&utm_medium=facebook

Once the player authenticates on your product, your backend must call the InTarget match API:

Endpoint:

POST https://api.intarget.app/rest/bot-link/match?access-token=<your_intarget_token>

Request body:

json

{
"loginHash": "<hash_from_url>",
"playerId": "<your_internal_player_id>",
"projectId": <your_intarget_project_id>
}


Successful response:

json

{
"data": {
"mapping_id": 9,
"messenger_user_id": "..."
}
}

Once this call succeeds, the player is matched and InTarget can send them messages via the connected Messenger or Instagram channel.

The access-token for the InTarget API is issued by InTarget — request it from your account manager.

Did this answer your question?