Guide

Web Pixel Integration Integracion del Web Pixel

Track everything on your website with a single JS snippet. Trackea todo en tu sitio web con un solo snippet de JS.

1

Add the pixel to your site Agrega el pixel a tu sitio

Paste this in your <head> tag. Replace YOUR_CLIENT_ID with the ID we give you. Pega esto en tu tag <head>. Reemplaza YOUR_CLIENT_ID con el ID que te damos.

<script>
// RELO Pixel — paste in <head>
(function(r,e,l,o){
  r.relo=r.relo||function(){
    (r.relo.q=r.relo.q||[]).push(arguments)
  };
  o=e.createElement('script');
  o.async=1;
  o.src=l;
  e.head.appendChild(o);
})(window,document,'https://p.relo.mx/r.js');

relo('init', { client_id: YOUR_CLIENT_ID });
relo('page');
</script>
2

Track purchases (optional but recommended) Trackea compras (opcional pero recomendado)

Fire this on your "thank you" / order confirmation page: Dispara esto en tu pagina de "gracias" / confirmacion de orden:

relo('event', 'purchase', {
  order_id: 'MX260312-12345',
  revenue:  24999,
  currency: 'MXN',
  products: [
    { id: 'SKU-001', name: 'Galaxy S24', price: 24999, qty: 1 }
  ]
});
3

That's it! Check your data Eso es todo! Revisa tus datos

Events will appear in your RELO dashboard within seconds. You can also check the health endpoint to verify the pixel is sending data. Los eventos apareceran en tu dashboard de RELO en segundos. Tambien puedes checar el endpoint de health para verificar que el pixel esta enviando datos.

Advanced Features (v3) Funciones Avanzadas (v3)

SHA-256 Device Fingerprinting Fingerprinting de Dispositivo SHA-256

The pixel collects 16 device signals (screen, timezone, languages, WebGL renderer, audio context, etc.) and generates a SHA-256 fingerprint using the async SubtleCrypto API. A djb2 hash fallback is used for browsers without SubtleCrypto. The fingerprint is included in every event for cross-session identity resolution. A fp_ready event fires when the fingerprint is computed. El pixel recolecta 16 senales del dispositivo (pantalla, zona horaria, idiomas, WebGL renderer, audio context, etc.) y genera un fingerprint SHA-256 usando la API asincrona SubtleCrypto. Un hash djb2 se usa como fallback para navegadores sin SubtleCrypto. El fingerprint se incluye en cada evento para resolucion de identidad cross-session. Un evento fp_ready se dispara cuando el fingerprint esta calculado.

Attention & Engagement Tracking Tracking de Atencion & Engagement

Automatically tracks active/hidden time on page (active_sec, hidden_sec) with a reason field (tab switch, minimize, etc.) and double-fire guard. Section-level attention tracking uses IntersectionObserver (0.1 threshold) to fire section_view events with 1-second dwell time minimum and a 500-object cap to prevent memory issues. Trackea automaticamente tiempo activo/oculto en pagina (active_sec, hidden_sec) con campo reason (cambio de tab, minimizar, etc.) y proteccion contra doble disparo. El tracking de atencion a nivel de seccion usa IntersectionObserver (threshold 0.1) para disparar eventos section_view con tiempo minimo de permanencia de 1 segundo y limite de 500 objetos para prevenir problemas de memoria.

Network Quality Detection Deteccion de Calidad de Red

Detects connection quality using navigator.connection API when available, with an XHR /ping RTT fallback for unsupported browsers. Fires a net_quality event with effective type (4g, 3g, 2g), downlink speed, and RTT. Used for adaptive content delivery and audience quality scoring. Detecta calidad de conexion usando la API navigator.connection cuando esta disponible, con un fallback XHR /ping RTT para navegadores no soportados. Dispara un evento net_quality con tipo efectivo (4g, 3g, 2g), velocidad de descarga y RTT. Usado para entrega adaptiva de contenido y scoring de calidad de audiencia.

Cross-Domain Identity Identidad Cross-Domain

For clients with multiple domains, the pixel supports cross-domain identity linking via relo('init', {domain: '.yourdomain.com'}). The cookie domain is sanitized and capped at 3KB. This links user sessions across subdomains for unified attribution. Para clientes con multiples dominios, el pixel soporta enlace de identidad cross-domain via relo('init', {domain: '.tudominio.com'}). El dominio de cookie se sanitiza y se limita a 3KB. Esto enlaza sesiones de usuario entre subdominios para atribucion unificada.

All Tracked Events Todos los Eventos Trackeados

// Automatic events
page_view      — every page load
fp_ready       — fingerprint computed
attention      — active/hidden time on unload
section_view  — section enters viewport (1s dwell)
net_quality   — network quality detected

// Manual events
view_product  — relo('event', 'view_product', {...})
add_to_cart   — relo('event', 'add_to_cart', {...})
purchase      — relo('event', 'purchase', {...})
custom        — relo('event', 'my_event', {...})