Social promotions
Turn a published Instagram post into a paid ad from the admin, with the most it can spend confirmed first, spending limits and optional approval; send the site's conversions to Meta and see what each promotion brought.
When a post does well, staff can put money behind it from Social → Insights → Paid ads. The post runs as an ad on the network, paid from the network's own ad account. The site never handles card details: the network charges the ad account's payment method.
Instagram is the first network that can promote. A network can promote only if its adapter declares a promotion capability. The server refuses a promotion on any other network before it calls anything.
Connect Instagram with Facebook login
Promotion needs the Instagram (Facebook login) provider, which is separate from the Instagram Login provider used for publishing alone. One Facebook consent screen grants everything needed to publish to the account and to promote its posts.
- In Meta for Developers, create a Business app and add Facebook Login for Business.
- In Social → Manage → Settings → Provider setup, choose Instagram (Facebook login). Copy the redirect URL shown there into the app's Valid OAuth Redirect URIs, then save the app ID and app secret.
- Under Social → Manage → Accounts, choose Connect Instagram (Facebook login) and log in with Facebook.
The Instagram account must be a professional account linked to a Facebook Page. The Page must belong to a Meta business portfolio with an ad account that has a payment method. The login asks for instagram_basic, instagram_content_publish, instagram_manage_comments, instagram_manage_insights, pages_show_list, pages_read_engagement, business_management, ads_management and ads_read. The token kept is Meta's long-lived token, extended on refresh.
Before an account's posts can be promoted, an account manager chooses which ad account pays for them, from the prompt at the top of Paid ads. The server refuses an ad account that cannot advertise as that Instagram account.
Promote a post
The Posts tab lists published posts on accounts that can promote, with the most engaging first. Promote opens a form:
- Goal: more engagement or more reach.
- Audience: countries and an age range (18 to 65+).
- Budget and schedule: a daily or total budget, with start and end dates.
The summary beside the form shows the most the promotion can spend. A daily budget counts for every day it runs; a total budget counts once. Review asks the server to check the site's limits and whether the network will promote the post. The person then ticks that they understand the amount and starts the promotion. Confirming sends back the exact figure shown, and the server refuses any other figure. Nothing reaches the network before this step. The network creates the campaign, ad set, creative and ad paused, then sets them running.
Limits and approval
On the Limits tab, an account manager can set:
- the most one promotion may spend;
- the most all promotions together may spend in a day, where a total budget counts as an even share of each day it runs;
- whether every promotion needs an account manager's approval before it starts.
A promotion that would pass a limit is refused, and the refusal names the limit. Limits are checked when a promotion is drafted, confirmed and approved. An account that requires approval for its posts also requires approval for its promotions.
Who may promote
Account managers may promote on every account. A publisher may promote only on accounts where they were given Promote posts with paid ads under publisher access. Only an account manager chooses the ad account, sets the limits, and approves or rejects a promotion.
Results
The Promotions tab lists every promotion with its status, what it has spent against the most it can spend, and its impressions, reach and clicks. Once Meta attributes any to it, a promotion also shows its leads, applications and purchases, and what the purchases came to. Meta attributes these only when the site sends its conversions (see Tracking below). A running promotion can be paused and resumed there. Every half hour the schedule (social-promotions, run_social_promotions()) collects the results of running and paused promotions, and marks a promotion finished once its end has passed. Every call to the network is kept as an attempt.
Tracking conversions
The Tracking tab sends the site's conversions to Meta's Conversions API, so Meta can measure an ad by what people did afterwards and show it to people likely to do the same. Only an account manager sees it.
- In Meta Events Manager, create a Pixel (a dataset) for the site, or use the one you have. Copy its Pixel ID.
- In the Pixel's Settings, under Conversions API, generate an access token.
- On the Tracking tab, paste both and save. The token is kept in Vault and never shown again. Paste a new one to replace it, or remove it to stop sending.
Then choose which conversions are sent. A form counts as a lead only if it is marked as a lead form in the form builder, such as a contact form (Forms). Each is recorded by the module that owns it and sent under Meta's standard event name:
| Conversion | Recorded when | Sent to Meta as |
|---|---|---|
| Sign-ups | an account is created | CompleteRegistration |
| Form leads | a lead form is sent (the forms module) | Lead |
| Applications | someone applies to an offer | SubmitApplication |
| Bookings | a booking is accepted (the sessions module) | Schedule |
| Purchases | a purchase is paid, with its value and currency | Purchase |
| Subscriptions | a membership starts | Subscribe |
A conversion is sent only for a person whose answer about advertising tags is yes (see Advertising consent). That answer is checked again at the moment of sending, so an opt-out stops what was already waiting. Every minute the schedule (social-conversions, run_social_conversions()) sends what is due, up to 500 events a request. Each event carries:
- an event id made from the record (
purchased:<id>), so a retry is counted once; - the person's email and account id as SHA-256 hashes, never in plain text;
- the browser ids, address and user agent kept with their consent;
- for a purchase, its value and currency.
A refused send is retried after 2, 4 and 8 minutes, then marked failed with Meta's message. The tab shows how many were sent and failed in the last seven days, how many are waiting, and the last error.
To check the setup, copy the Test event code from Events Manager → Test events into the tab. Events then show in Events Manager's test view, which updates live, and do not count towards ads. Empty the field when you are done.
On public pages the Meta Pixel loads only once the visitor's answer is yes, and sends page views only. Meta's automatic advanced matching is off; conversions go from the server alone.
Your privacy policy must say that you share these events with Meta. The site's own policy is yours to write. The banner and the footer link point to /privacy unless the privacy strings say otherwise.
The website-conversion goal (optimising a promotion for a Pixel event) is not offered. Meta's documentation for ads made from an existing Instagram post does not confirm that such an ad can optimise for a Pixel event, so promotions keep the engagement and reach goals.
Testing
META_MOCK=1 answers every Meta call, for promotions and conversions alike, with made-up ids and figures, so no ad is made or paid for and no conversion is sent. A test event code of MOCKFAIL makes the mock refuse a send as Meta would. The end-to-end run and npm run dev set it unless .env sets it. The deploy refuses it in production. social-promotion.test.mts covers the contract, the money rules, what is sent to Meta and the Facebook login, under Node. social-promotion-db.test.mts covers the served flow against the test stack. meta-conversions.test.mts covers what is sent to the Conversions API, under Node. meta-conversions-db.test.mts covers the consent the door keeps, the queue, sending, retries and opt-outs against the test stack.