Optimads/Info
Enter the app

Events from code.

On a custom-built website you send events with optimads.track(). Each event goes to the pixels in the browser and from our server with the same code, so it is counted only once.

≈ 6 min Updated Oct. 15, 2026
What you need

Syntax

JavaScript
optimads.track('EventName', { /* fields */ });

The script loads asynchronously. If you send an event before window.optimads exists, put it in the queue. The queue empties on its own when the script starts:

Before the script loads
window.__oaQ = window.__oaQ || [];
__oaQ.push(['Lead', { content_name: 'Quote request' }]);

Standard events

These are sent both from the browser and from the server:

EventWhen you send it
PageViewAutomatically, don't send it yourself.
ViewContentA product page.
AddToCartA product added to the cart.
InitiateCheckoutThe start of checkout.
AddPaymentInfoThe payment method chosen.
PurchaseThe order placed, only once.
LeadA request sent successfully.
CompleteRegistrationAn account created.
SubscribeA newsletter signup.
ContactAutomatically, on a click on phone, email, WhatsApp.
SearchA search on the site.
Any other name goes only to the pixels in the browser. To send it from the server too, make it a custom action of the “From code” type.

Fields

FieldWhat you put
valueThe value, as a number: 249.90.
currencyThe 3-letter currency code: RON, EUR.
order_idThe order number.
content_idsThe product IDs, as a list: ['SKU-1'].
contentsThe products, with quantity and price: [{ id, quantity, item_price }].
content_nameThe name of the product or of the form.
content_categoryThe category.
num_itemsThe number of products.
search_stringThe search text, for Search.

To match the buyer, you can also send em (email), ph (phone), fn, ln (first name, last name), ct (city), country. We turn them into code (a hash) on the server, and the browser pixel doesn't receive them.

Examples

Product page
optimads.track('ViewContent', {
  content_ids: ['SKU-1'],
  content_name: 'Black T-shirt',
  value: 89,
  currency: 'RON'
});
Thank-you page
optimads.track('Purchase', {
  value: 249.90,
  currency: 'RON',
  order_id: '10234',
  contents: [{ id: 'SKU-1', quantity: 2, item_price: 89 }],
  em: 'client@exemplu.ro',
  ph: '0722123456'
});
Form sent
optimads.track('Lead', { content_name: 'Quote request' });
Purchase, only once per order. Don't send it every time the thank-you page reloads. On connected stores (Shopify, WooCommerce, Gomag, MerchantPro, PrestaShop) you don't need to send it at all: the real order is sent from the server.
Stuck?Send us your website address and the step you're on. We'll help you.
contact@optimads.ai