$ 29.99
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Discuss (mail) • Website (website) • Invoicing (account) |
| Lines of code | 1334 |
| Technical Name |
dotbd_tiktok_pixel_eapi |
| License | OPL-1 |
| Website | https://www.dotbdsolutions.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Discuss (mail) • Website (website) • Invoicing (account) |
| Lines of code | 1334 |
| Technical Name |
dotbd_tiktok_pixel_eapi |
| License | OPL-1 |
| Website | https://www.dotbdsolutions.com |
TikTok Pixel & Conversion API
Complete browser-side Pixel + server-side Conversion API tracking for Odoo 19 — with automatic event deduplication.
Key Features
Browser Pixel + EAPI Mirror
Every ttq.track() call is immediately relayed server-side to the
TikTok Events API with the same event_id. TikTok deduplicates the
pair — you get both browser signals and server-side reliability.
Full Funnel Coverage
14 events tracked automatically: PageView, ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, PlaceAnOrder, Purchase, CompleteRegistration, Search, AddToWishlist, Subscribe, Contact, SubmitForm, SubmitApplication.
Advanced Matching — Logged-in Users
SHA-256 hashed email, phone_number (E.164 normalized),
and external_id injected server-side via ttq.identify()
for every logged-in customer on every page.
Advanced Matching — Anonymous Users
Email and phone are captured from form fields at submission time, hashed
client-side with crypto.subtle (SHA-256), and passed to
ttq.identify() before the event fires — matching anonymous
visitors who fill in contact, lead, or job application forms.
Event Registration Tracking
Tracks Odoo website_event flows: ViewContent on the
event page and CompleteRegistration on the confirmation page.
Attendee email/phone are captured from the registration form via
sessionStorage before the native redirect.
ttclid & ttp Support
Captures TikTok Click ID (ttclid) from the landing URL and
_ttp cookie from the browser. Both forwarded to EAPI as plain
text for strongest attribution without hashing.
Per-Website Configuration
Override Pixel ID, Access Token, and Test Event Code independently per Odoo Website. Global settings act as the default; per-website fields take priority. Ideal for multi-website setups with separate TikTok ad accounts.
Test Events Tab Support
Test Event Code is passed to both ttq.load() (browser pixel) and
every EAPI payload (server-side) so all events appear in TikTok Events Manager
→ Test Events without affecting real campaign data.
Spec-Compliant Event Structure
Every event sends contents[{content_id, content_type, content_name}],
value, and currency exactly as TikTok's official Events API
v1.3 spec requires. Empty / null fields are stripped client-side and server-side,
so events never trigger "missing parameter" validation warnings.
Cart Snapshot Across Funnel
When the user adds an item to the cart, a snapshot of contents +
value + currency is persisted to sessionStorage
and reused by InitiateCheckout, AddPaymentInfo, and
PlaceAnOrder — so every funnel event carries the full product data,
not just a currency tag.
Built-in Debug Logging
Every browser event is logged to the console as
[TikTok Pixel] fire ViewContent {…}, and every EAPI relay is logged to
the Odoo log as INFO ... TikTok relay: event=… event_id=… pixel=… url=….
Misconfigurations produce explicit warnings — no silent failures.
Coexists with Meta Pixel
Designed to run alongside dotbd_meta_pixel_capi without method-name
conflicts on shared Odoo models (website,
payment.transaction, res.users,
res.config.settings). Both modules can be installed simultaneously.
Events Tracked
| Event | Trigger | Browser Pixel | Server EAPI |
|---|---|---|---|
| PageView | Every page render | ttq.page() — QWeb template |
Background thread on render |
| ViewContent | Product detail page or event page | ttq.track() — DOM detection |
JS relay |
| AddToCart | Add to cart action | add_to_cart_event on .oe_website_sale |
JS relay |
| InitiateCheckout | /shop/checkout or /shop/address | ttq.track() — URL detection + cart snapshot |
JS relay |
| AddPaymentInfo | /shop/payment page | ttq.track() — URL detection + cart snapshot |
JS relay |
| PlaceAnOrder | Pay button clicked on /shop/payment | ttq.track() — submit button click |
JS relay |
| Purchase | Payment confirmed | ttq.track() — window._ttPurchaseData |
payment.transaction._post_process() |
| CompleteRegistration | Event registration confirmation page | ttq.track() — .o_wereg_confirmed |
JS relay |
| Search | Search form submit | .o_searchbar_form submit |
JS relay |
| AddToWishlist | Wishlist button click | .o_add_wishlist / .o_add_wishlist_dyn |
JS relay |
| Subscribe | Newsletter subscription success | MutationObserver on .js_subscribed_wrap |
JS relay |
| Contact | Contact or lead form submit | MutationObserver on s_website_form (mail.mail, crm.lead) |
JS relay |
| SubmitForm | Generic website form submit | MutationObserver on s_website_form |
JS relay |
| SubmitApplication | Job application form submit | MutationObserver on s_website_form (hr.applicant) |
JS relay |
Advanced Matching & PII Handling
All PII is hashed with SHA-256 before leaving your server or browser, following TikTok's official normalization specification (Events API v1.3):
| Field | Normalization | Where hashed |
|---|---|---|
email | Lowercase, trim whitespace, SHA-256 | Server (Python) + Browser (crypto.subtle) |
phone_number | Normalize to E.164 (+{cc}{number}), SHA-256 | Server (Python) + Browser (crypto.subtle) |
external_id | Odoo partner.id as string, SHA-256 | Server (Python) |
ip | Plain text (not hashed) | Server — from HTTP request |
user_agent | Plain text (not hashed) | Server — from HTTP request |
ttclid | Plain text (not hashed) | URL param + cookie |
ttp | Plain text (not hashed) | _ttp cookie |
Form-level Advanced Matching (anonymous users)
When an anonymous user submits a contact, lead, job application, or newsletter form,
the module reads their email and phone from the form fields, hashes them client-side
using the Web Crypto API (crypto.subtle), and calls ttq.identify()
before firing the conversion event. This maximises match rates even for users who are not
logged in to Odoo.
For event registrations (website_event), the attendee's email and phone are
captured from the registration form via sessionStorage before the native
form POST redirect, then used on the confirmation page.
TikTok Events Manager Setup
Before configuring this module in Odoo, set up your pixel and Events API in TikTok Ads Manager → Events Manager. The screenshots below walk through the four key steps.
Step 1 — Locate your Pixel ID
In Events Manager, open your pixel from Data sources. Copy the Pixel ID shown at the top — you'll paste this into the Odoo settings page.
Step 2 — Enable Automatic Advanced Matching (AAM)
Under Manage configurations, turn on Automatic Advanced Matching and tick at least Email, Phone number, and External ID. This module already pre-hashes these fields with SHA-256 client- and server-side before sending — TikTok requires AAM to be enabled on the pixel side to consume them.
Step 3 — Generate the Events API Access Token
Under Implement Events API, click Generate access token and copy the token immediately (TikTok does not save it). Paste this into the Odoo settings page as the Events API Access Token.
Step 4 — Verify with Test Events
After installing the module in Odoo, open Test events in Events Manager and visit your website. You should see deduplicated Server + Browser pairs for every event. Optionally install the TikTok Pixel Helper Chrome extension for additional in-browser verification.
Odoo Configuration
- Go to Website → Configuration → Settings → TikTok Pixel & Events API
- Enable the toggle and enter your Pixel ID
- Paste your Events API Access Token (TikTok Ads Manager → Assets → Web Events → Settings → Generate Access Token)
- Optionally enter a Test Event Code from Events Manager to verify events without affecting real campaign data
- Save — the pixel injects on all website pages immediately
Per-Website Override
Go to Website → Configuration → Websites, open a website record, and set the fields on the TikTok Pixel tab. These override the global settings for that specific website only. Leave blank to inherit the global configuration.
Technical Details
- Odoo Version: 19.0
- Dependencies:
website_sale,payment,auth_signup - TikTok Events API:
v1.3 - License: OPL-1
- 14 standard events tracked end-to-end — full e-commerce funnel + forms + event registrations
- No third-party Python packages required (uses Odoo's bundled
requests) - Browser PII hashing uses native
window.crypto.subtle— no external libraries - Bot and prefetch requests are filtered server-side before EAPI calls
- Per-request
event_idcaching prevents duplicate EAPI calls on multi-render pages - Empty / null / empty-array values are stripped from event payloads both client-side
(
_ttCleanProps) and server-side (build_tiktok_event) so TikTok never receives malformed parameters - Cart snapshot persisted in
sessionStorageafter AddToCart so checkout-funnel events carry full product data - Console + Odoo log debug output for every browser event and every EAPI relay call
- Versioned static asset URL (
?v=1.4) busts browser cache on every upgrade - Method-name isolation from
dotbd_meta_pixel_capi— Meta and TikTok modules run independently on the same Odoo instance
Support
Developed and maintained by Dot BD Solutions Limited.
Website: www.dotbdsolutions.com
Email: rajib@dotbdsolutions.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module