Lomadee Global Pixel
The Lomadee Global Pixel is a complete tracking solution that offers advanced functionality for conversion tracking, events, and real-time user data collection.When to Use Global Pixel
Use Global Pixel when:- You need automatic event tracking (clicks, pageviews)
- You want to send detailed customer and product data
- Your platform supports advanced JavaScript
- You need features like custom metadata
- You want a simpler implementation
- Your platform has JavaScript limitations
- You only need basic conversion tracking
How It Works
The Global Pixel is an asynchronous script that automatically:- Captures parameters from URLs coming from Lomadee shortened links
- Tracks events like page views and clicks
- Processes conversions when you call the
sendOrder()method - Sends data asynchronously to Lomadee servers
Installation
Step 1: Initialize the Pixel
Add this code to your site’s<head>, before the closing </head> tag:
window.lomadeePixel is always a Promise in this installation model. It can be
used before or after the external script finishes loading. The initialized
instance is also available as window.lomadeePixelInstance after the Promise
resolves.
Step 2: Google Tag Manager Implementation (Optional)
If you use GTM:- Create a new Custom HTML tag.
- Paste the initialization code from Step 1.
- Set the trigger to Initialization – All Pages.
- Configure the tag to fire once per page.
- Publish the container version.
Existing installations that assign an instance directly to
window.lomadeePixel remain supported and do not need to be migrated. The
Promise-based contract documented here applies to new installations.Sending Conversions
When to Send
Call thesendOrder() method only on the purchase confirmation page, after payment is approved. Important: Do not send on checkout or cart pages.
Basic Implementation
On your success/confirmation page, add the conversion code:Multiple Products Example
Data Structure
string
required
Unique identifier for the order
object
object
required
array
required
Array containing main order values
number
required
Total order value in cents. This is the sum of all subItems values (Items + Shipping + Discounts + other fees)
object
Additional order data
SubItems
ThesubItems object stores order information such as shipping, items, discounts, and other values not directly related to products. Important notes:
- The total value of
Itemsmust reflect the final price of each product after applying discounts - Discounts applied directly to products should be reflected in each item’s
price - General order discounts (such as coupons or payment method discounts) should be included in
subItemsusing theDiscountskey - Any other type of discount, such as fees, cashback, etc., should be included in
subItemsusing a key with the discount name and value
Important Notes About Discounts
-
Product-Specific Discounts: These should be reflected in each product’s
pricefield. For example, if a product has a 10% discount, thepriceshould be 90% of thelistPrice. -
General Discounts: Discounts applied at checkout (such as coupons or payment method discounts) should be included in
subItemswith the key “Discount”. This discount should also be applied to the final product value. For example, if a 5% discount is applied for using a specific payment method, it should be applied to the final price of each product in the order. -
Commissioning: Lomadee’s commissioning algorithm considers the final value of each product (
price), not the total order value after general discounts, for commission calculation. Therefore, it’s crucial that product-specific discounts are correctly reflected in each item’sprice. For example, if a 5% discount is applied for using a specific payment method, it should be applied to each item’sprice.
Metadata
Themetadata field is an array that allows sending custom information for specific contexts. It can be used at different levels of the order structure:
- Order level (
order.metadata) - Customer level (
customer.metadata) - Product level (
items[].metadata) - Category level (
items[].categories[].metadata)
metadata array must follow the key and value structure:
Usage Examples
- At order level:
- At customer level:
- At product level:
- At category level:
Important Notes
- Keys must be strings and are case-sensitive
- Values can be strings, numbers, or booleans
metadatais optional at all levels- Use this field to send additional information that may be useful for specific analyses or integrations
Google Tag Manager Implementation
If you’re using GTM, you can implement the conversion tracking using GTM variables and triggers:Step 1: Create GTM Variables
First, create these variables in GTM: Built-in Variables:- Enable “Enhanced Ecommerce” variables
- Enable “Page URL” and “Page Path”
Step 2: Create Conversion Tag
Create a new Custom HTML tag with this code:Step 3: Configure Trigger
Create a trigger that fires on purchase confirmation: Trigger Type: Custom Event Conditions:- Custom Event equals your confirmed purchase event, such as
purchase - Fire the tag once per order
Step 4: DataLayer Configuration
For better integration, configure your dataLayer on the confirmation page:Step 5: Advanced GTM Variables
Create these custom JavaScript variables for more complex scenarios: Variable Name: Lomadee Items ArrayStep 6: Testing in GTM
Use GTM Preview mode to test:- Enable Preview Mode in GTM
- Navigate to confirmation page with test purchase
- Check Console for success/error messages
- Verify in Network tab that Lomadee requests are sent
- Check GTM Debug panel for variable values
GTM Best Practices
Testing: Use GTM’s preview mode extensively to test all scenarios before
publishing.
Validation and Testing
How to Verify It’s Working
- Open DevTools (F12) on the page where you implemented the pixel
- Go to Console tab and check for errors
- Go to Network tab and look for:
- Script loading:
pixel.js - Requests to Lomadee domains after calling
sendOrder()
- Script loading:
Implementation Checklist
Complete Verification List
Complete Verification List
Basic Installation:
- Script included in page
<head> - Pixel initialized correctly
- No errors in browser console
-
sendOrder()called ONLY on confirmation page -
orderIdis unique for each order - Prices are in cents (e.g., 9990 for $99.90)
- All required fields are filled
-
pricerepresents final value after discounts -
listPriceis original price without discount -
quantityis an integer - Categories are filled correctly
- “Items” contains sum of all final products
- “Shipping” contains shipping value
- “Discounts” contains general discounts (negative value)
- “value” contains total order value (sum of all subItems)
Development Environment Testing
Error Handling
Robust Implementation
Troubleshooting
Common Issues
Pixel not initializing
Pixel not initializing
Symptoms:
- “lomadeePixel is not defined” error in console
- Script doesn’t appear in Network tab
- Check if script is in page
<head> - Check if ad blockers are active
- Check if CDN is accessible
- Try loading script without
asynctemporarily
Conversions not being sent
Conversions not being sent
Symptoms:
sendOrder()doesn’t generate Network requests- No success logs in console
- Check if calling
sendOrder()on correct page - Check if all required fields are filled
- Check if prices are in cents
- Check if there are no JavaScript errors on page
Incorrect data being sent
Incorrect data being sent
Symptoms:
- Commissions not being calculated correctly
- Products don’t appear in reports
- Check if
pricehas final value after discounts - Check if
subItems.Itemsis sum of all products - Check if not sending same
orderIdmultiple times - Check if categories are in correct format
Advanced Debug
Important Considerations
Price Format: All monetary values must be in cents. $99.90 = 9990 cents.
Platform Integration
WordPress/WooCommerce
Shopify
Support
For questions or issues:- Technical documentation: Check this complete documentation
- Technical support: Lomadee Help Center
- Direct contact: Contact our technical team
Useful Information for Support
When contacting support, have on hand:- URL of page where pixel is implemented
- Example of data being sent in
sendOrder() - Screenshots of console errors (if any)
- Browser and version being used