Appearance
Ad Pixels
Meta, TikTok, LinkedIn, Google Ads, Microsoft Advertising, Pinterest, Snapchat and X pixels on the site's pages, with the shop's sales as conversions.
kitloom/ · admins: kitloom/, kitloom/
Video lessons
Recorded in the Filament admin; the Nova admin works the same way.
The ad networks' pixels on the site's pages: Meta (Facebook and Instagram), TikTok, the LinkedIn Insight Tag, the Google Ads tag, Microsoft Advertising (UET), Pinterest, Snapchat and X (Twitter). Ads can then be measured, and site visitors can be found again in the networks' audiences. It does what the networks' own WordPress plugins, PixelYourSite or Site Kit did on the WordPress site, and their IDs can be imported. The admin page is the Ad Pixels section (kitloom/ad-pixels-filament or kitloom/ad-pixels-nova).
Setting it up
Open Ad Pixels → Settings and fill in the IDs of the networks you advertise on. An empty ID means that pixel is off. An ID that does not look like one is refused when you save, so a typo never reaches the site.
| Pixel | What to enter | Where to find it |
|---|---|---|
| Meta | The pixel (dataset) ID, digits | Meta Events Manager → Data sources |
| TikTok | The pixel code, C… | TikTok Ads Manager → Assets → Events → Web events |
| The partner ID, digits | Campaign Manager → Analyze → Insight Tag | |
| Google Ads | The conversion ID, AW- and digits | Google Ads → Goals → Conversions → a conversion action → Tag setup: the AW- part of send_, before the slash |
| Google Ads purchase conversion label (optional) | The label of your purchase conversion, such as Ab | The same Tag setup of your purchase action: the part of send_ after the slash |
| Microsoft Advertising | The UET tag ID, digits | Microsoft Advertising → Conversions → UET tag |
| The tag ID, digits | Pinterest Ads Manager → Conversions | |
| Snapchat | The Snap pixel ID, such as 1a2b3c4d- | Snapchat Ads Manager → Events Manager → your Snap pixel |
| X | The pixel ID, a few letters and digits such as o1a2b | X Ads → Tools → Events Manager → your X pixel |
| X purchase event ID (optional) | The ID of a Purchase event, tw- | X Events Manager: add a Purchase event to your pixel and copy its ID |
Every page of the theme gets:
- each pixel's base code with its page view, where the theme put
@site;Head - for visitors without JavaScript, Meta's, LinkedIn's, Microsoft's and Pinterest's image right after
<body>(@site). Google Ads, TikTok, Snapchat and X have no such image.Body Open
In an Inertia theme, the next page opens without a reload:
- Meta, TikTok, Google Ads, Pinterest and Snapchat are sent a page view for it by the module.
- Microsoft's UET tag notices the new address by itself (its automatic tracking of single-page sites is on).
- LinkedIn's and X's tags have no page-view call to repeat, so they count the first page.
Shop sales
With the shop module, the pixels also receive the shop's sales as their networks' standard events:
| Shop | Meta | TikTok | Google Ads | Microsoft | Snapchat | X | |
|---|---|---|---|---|---|---|---|
| A product page is opened | View | View | view_ | product page (ecomm_) | pagevisit | VIEW_ | — |
| A product goes into the cart | Add | Add | add_ | add_ | addtocart | ADD_ | — |
| The checkout form is opened | Initiate | Initiate | — | begin_ | initiatecheckout | START_ | — |
| The "order received" page is shown | Purchase | Complete | purchase, and the conversion if its label is filled in | purchase | checkout | PURCHASE | your purchase event, if its ID is filled in |
Each event carries the products, the value and the currency, in the names each network uses. A product is named as the Ads module's product feed names it — its SKU, or its number where it has none; a variation by its own — so a catalogue filled from that feed (Meta, Google Merchant Center, Pinterest, Microsoft) recognises what was viewed and bought, which dynamic and catalogue ads depend on:
- Google Ads: the products as
itemswithgoogle_, which dynamic remarketing reads; every event is sent to yourbusiness_ vertical: retail AW-account only. With the purchase conversion label, a purchase is also counted as that conversion, with the value, the currency and the order number (… transaction_), so a reload does not count it twice. Google lists no checkout event for remarketing, so none is sent.id - Microsoft Advertising:
ecomm_andprodid ecomm_(dynamic remarketing),pagetype ecomm_,totalvalue currencyanditems; a purchase alsorevenue_andvalue transaction_. To count purchases as conversions, make a goal in Microsoft Advertising for the event actionid purchase, with revenue from the tag. - Pinterest:
value,currency,order_and the products asquantity line_; a checkout alsoitems order_.id - Snapchat:
price,currency,item_andids number_; a purchase alsoitems transaction_.id - X: conversions on X are events you make in X Events Manager, each with its own ID; this module sends the purchase to the one you name, with
value,currencyand the products ascontents.
A purchase also carries the event ID purchase- (Meta, TikTok, Pinterest; X's conversion_), which is how Meta matches it to the same purchase sent from the server (below). Each order is sent once per browser. A failed or cancelled order is not sent.
Meta Conversions API: purchases sent from the server
A pixel in the browser misses the purchases of visitors with an ad blocker, and part of those on Safari and iOS. With the shop module and an access token, every purchase is also sent to Meta from the server, so your ads are measured and taught by all of them.
- In Meta Events Manager, open your pixel (dataset) → Settings → Conversions API → Generate access token, and copy it.
- Paste it into Meta Conversions API access token on Ad Pixels → Settings and save. The token is kept encrypted and is never shown again; an empty field keeps the saved one.
- To try it first: Events Manager → Test events shows a code such as
TEST12345. Put it into Meta test event code, place an order, and watch it appear on that tab. Events with a code are not counted, so empty the field when you are done.
What happens then:
- When. Once an order is paid (Processing or Completed) or put On hold for a payment made by hand — the orders the pixel on the "order received" page counts. An order still waiting for its payment is sent when the payment arrives; a failed or cancelled one never is. Each order is sent once.
- No double counting. The server's purchase carries the same event ID as the browser's,
purchase-, and Meta keeps one of the two.{order number} - What is sent. The products, the value and the currency as the pixel sends them; the order's email, phone, name, city, region, postcode and country, each hashed (SHA-256) as Meta requires; the IP address and browser the order was placed from; the pixel's own browser and click IDs (the
_andfbp _cookies) and the checkout page's address.fbc - Who is not sent. The same visitors the pixel leaves alone: one who did not agree to marketing in the Cookie Consent banner (no answer counts as no), and signed-in users unless Track signed-in users is on. For them the order keeps nothing for Meta.
- From the queue. The customer's page never waits for Meta. A site without a queue worker sends it at the end of the checkout request. A failed send is tried again for a few hours; what Meta answered last is shown under the token field.
- Privacy requests. With the Privacy module, Export Personal Data lists what an order kept for Meta under "Ad tracking of orders", and Erase Personal Data removes it.
Only purchases are sent from the server. Product views, carts and checkouts started still come from the browser's pixel.
The Graph API version is pinned in config/ (conversions.), where conversions. also turns the whole thing off.
LinkedIn conversions are set up in Campaign Manager, by URL (the "order received" page) or by event.
Consent
Ad pixels are marketing. With the Cookie Consent module installed, each pixel waits until the visitor agrees to marketing. The images for visitors without JavaScript are left out: without JavaScript there is nobody to ask. Without a consent module, the pixels load at once.
The Google Ads tag is the exception when the banner's Google Consent Mode is on: then it loads at once, after the consent defaults (ads denied), and Google keeps to the visitor's answer — no ad cookies until they agree to marketing. If Google Analytics is on the page too (the Analytics module), both share one Google tag.
Who is tracked
Signed-in users (editors, administrators, customers with an account) are not tracked by default, so the site's own people do not end up in the ad audiences. Track signed-in users turns that off. Pages for guests are cached as before: a signed-in user's page is always drawn anew, so leaving the pixels out of it affects nobody else.
Coming from WordPress
If the WordPress site had one of these plugins, the settings page shows an Import button. The console command does the same:
bash
php artisan ad-pixels:import
php artisan ad-pixels:import --from=meta --from=tiktok --from=sitekit| Plugin | What is taken |
|---|---|
| Meta pixel for WordPress | The pixel of its current connection, otherwise of its older settings |
| TikTok | The pixel code |
| LinkedIn Insight Tag | The partner ID, if the tag was on. A pasted snippet works too. |
| PixelYourSite | The first Meta pixel, if its Meta pixel was on (from its own pys_ table, or from the options) |
| Site Kit by Google | The Google Ads conversion ID of its Ads module (the one Google's partner setup made first, then the one typed in) |
Only the IDs are taken. Not carried over:
- Microsoft, Pinterest, Snapchat and X IDs, and the Google Ads purchase conversion label: their WordPress plugins are not read yet, so type them in once on the settings page.
- Server-side tokens (Meta's Conversions API, TikTok's Events API, the other networks' conversion APIs). They stay where they are: this module sends nothing from the server.
- Advanced matching (visitors' emails sent to the networks).
- Events beyond the page view and the shop's sales, such as leads.
The plugins' own settings are not touched.
For developers
- Settings:
ad_, declared bypixels_ * Adand written throughPixels Options Setting. An ID that does not look like one is never put into a page.Writer - How the pixels reach the page:
Adis thePixels Scripts Page.Scripts Provider - Each network is a
Pixels\, with its head code and its image.Pixel - Both go through kitloom/site's
Scriptas marketing; the Google Ads tag says it reads Google Consent Mode (Consent:: gate() Pixel::).google Consent Mode()
- CSP: a nonce set with
Vite::goes on the scripts.use Csp Nonce() - Config:
php artisan vendor:publishes the admin sections switch.publish -- tag=kitloom- ad- pixels- config - Tests, from the application that installs the package:
php vendor/.bin/ phpunit -- testsuite Ad Pixels