Magento.
The Optimads module puts the script on every page, checkout included, and reports orders the moment they come in. A read-only integration brings in the real orders.
- Magento 2.4 (Open Source) or Adobe Commerce, with administrator access.
- For the module: someone who can run
bin/magentocommands on the server (usually the store's developer). - The Meta pixel chosen in Optimads, under Connections. TikTok is optional.
1. The integration, for orders
Add the integration
In the Magento admin: System → Extensions → Integrations → Add New Integration. Name: Optimads. Under Your Password, enter your administrator password.
Tick only what we need
In the API tab, under Resource Access, choose Custom and tick:
Sales → Operations → Orders → Actions → Viewand Stores → Settings → All Stores (currency and time zone). For product costs in your profit figures, also Catalog → Inventory → Products. Leave the rest unticked.
Activate
Save & Activate, then Allow. Magento shows you 4 codes: Consumer Key, Consumer Secret, Access Token and Access Token Secret.
Connect in Optimads
Click “Connect Magento” and fill in the store address and the 4 codes. If Magento runs in a folder, add the folder too, for example yoursite.com/shop.
Orders come in on their own, every few minutes. With the integration we only read them; we don't change anything in the store.
2. The Optimads module
Download the module
In Tracking → Setup → Store installation, Magento tab, click “Download the module”. It comes already configured for your account.
Put it in Magento
Unzip the file into the store's main folder:
app/code/Optimads/Trackingappears.Run the commands
On the server, in the store's folder:
bin/magento module:enable Optimads_Trackingbin/magento setup:upgradebin/magento cache:flushIf the store is in production mode, also run
bin/magento setup:di:compileandbin/magento setup:static-content:deploy -fin between. The exact commands, ready to copy, are also in the Magento tab.
The module puts the script on every page, checkout included, sends the exact order value on the thank-you page and reports orders right away. Its settings are in Stores → Configuration → Optimads → Tracking.
3. Turn off the old pixels
Disable the Meta extension (Meta Business Extension or Facebook Business Extension) and the TikTok pixel from other extensions. They send the same sales with different codes, and Meta and TikTok would count them twice. If the Meta extension also runs your catalog, turn off only the pixel and Conversions API.
In Meta Events Manager, also turn off Tracking without code. Details: Old pixels and duplicates.
Without the module
You can put the script in Content → Design → Configuration → your store → HTML Head → Scripts and Style Sheets. You'll find it in the Magento tab, under “Without the module: the script in HTML Head”. Without the module, the checkout step isn't tracked, and we send the order value from the server, from the store. If you install the module later, the script in HTML Head can stay: it won't load twice.
Common problems
“Magento refused the request signature”
One of the two secret codes (Consumer Secret, Access Token Secret) wasn't copied in full. Copy them again from System → Extensions → Integrations → Optimads.
“Magento doesn't give access to orders”
On the integration, in the API tab, tick Sales → Operations → Orders → Actions → View, save and click Reauthorize.
“The integration can't read the store settings”
Tick Stores → Settings → All Stores on the integration and reconnect: that's how we read the exact currency and time zone.
“Magento has stopped giving us the orders”
Check that the Optimads integration is still active in System → Extensions → Integrations.