diff --git a/_config.yml b/_config.yml index dfa76ea1..e5aab6ee 100644 --- a/_config.yml +++ b/_config.yml @@ -220,6 +220,8 @@ collections: - api.md - send-sms-with-api.md - tracking-events.md + - custom-actions.md + - objects.md - tracking-on-campaigns-and-journeys.md - tracking-unidentified-customers.md - external-tracking.md diff --git a/_developers/custom-actions.md b/_developers/custom-actions.md new file mode 100644 index 00000000..f5d86cfa --- /dev/null +++ b/_developers/custom-actions.md @@ -0,0 +1,19 @@ +--- +languages: ["en", "es"] + +en: + title: Custom actions + description: Define business-specific activity and track it from Hellotext.js, the API, or a customer profile. +es: + title: Acciones personalizadas + description: Define actividad específica de tu negocio y regístrala desde Hellotext.js, la API o un perfil del cliente. + +permalink: custom-actions +permalink_es: acciones-personalizadas + +layout: guide +topic: developers +popular: false +--- + +{% translate_file developers/custom-actions.md %} diff --git a/_developers/objects.md b/_developers/objects.md new file mode 100644 index 00000000..d7182369 --- /dev/null +++ b/_developers/objects.md @@ -0,0 +1,19 @@ +--- +languages: ["en", "es"] + +en: + title: Objects + description: Model business entities, define their properties, and associate object instances with tracked events. +es: + title: Objetos + description: Modela entidades del negocio, define sus propiedades y asocia instancias de objetos con eventos registrados. + +permalink: objects +permalink_es: objetos + +layout: guide +topic: developers +popular: false +--- + +{% translate_file developers/objects.md %} diff --git a/_i18n/en/audience/custom-properties-and-events.md b/_i18n/en/audience/custom-properties-and-events.md index a0f68a75..7bae214f 100644 --- a/_i18n/en/audience/custom-properties-and-events.md +++ b/_i18n/en/audience/custom-properties-and-events.md @@ -97,6 +97,8 @@ Marking an action as a conversion lets reports treat its events as conversions. Treat the tracking name as a contract with your site, backend, and integrations. If you change it, update every source that sends the event. Deleting a custom action also deletes its associated events and cannot be undone. +Read [Custom actions]({% link _developers/custom-actions.md %}) for the complete setup, tracking, object, and troubleshooting workflow. + ## Record and review events Events can arrive automatically from a connected store, capture, conversation, Hellotext.js, API, or custom integration. @@ -150,5 +152,6 @@ Before relying on a custom property or event: - [Build segments]({% link _audience/segments.md %}) - [Personalization tags]({% link _audience/personalization-tags.md %}) - [What are signals?]({% link _journeys/what-are-signals.md %}) +- [Custom actions]({% link _developers/custom-actions.md %}) - [Tracking events]({% link _developers/tracking-events.md %}) - [Verify your data and signals after setup]({% link _integrations/verify-data-and-signals.md %}) diff --git a/_i18n/en/developers/custom-actions.md b/_i18n/en/developers/custom-actions.md new file mode 100644 index 00000000..f61c4989 --- /dev/null +++ b/_i18n/en/developers/custom-actions.md @@ -0,0 +1,165 @@ +A custom action defines business-specific activity that Hellotext does not include among its built-in actions. For example, you can define `appointment.booked`, `loyalty.reward_redeemed`, or `physical_store.payment_completed`. + +The action is the reusable definition. Every time that activity occurs, you track an **event** using the action's tracking name. Hellotext can use those events as signals in customer profiles, segments, journeys, reports, and other compatible features. + +## Before creating an action + +First review the built-in actions under **Settings > Actions**. Hellotext already includes common eCommerce, messaging, form, subscription, and conversation activity. + +Use a custom action when you need to track something that happened at a specific time and there is no equivalent action. Use a customer profile property when the data describes a current state that can change, such as loyalty tier, preferred store, or renewal date. + +Do not create another action to replace `order.placed`, `product.viewed`, or an equivalent built-in activity. Playbooks and reports may depend on the meaning and associated object of the original action. + +## Create an action in Hellotext + +You need a plan and permissions that support custom actions. + +1. Open **Settings**. +2. Select **Actions**. +3. Open the **Custom** tab. +4. Click **Create new action**. +5. Enter the readable name and tracking name. +6. Decide whether to mark it as a conversion or as important. +7. Save the action. + +The **readable name** is the label your team sees in Hellotext. The **tracking name** is the exact identifier your site, backend, and integrations must send. + +## Choose a stable tracking name + +Use lowercase and separate the object from the activity with a period. For example: + +- `appointment.booked` +- `membership.renewed` +- `quote.requested` +- `store_visit.completed` + +Each tracking name must be unique within the business and cannot use the name of a built-in action. + +Treat it as a technical contract. If you change `appointment.booked` to `appointment.scheduled`, you must also update every site, backend, integration, segment, or journey that uses the previous name. + +## Configure its effect + +### Mark as a conversion + +Use this option when an occurrence represents a result you want compatible reports to count as a conversion. + +Marking the action does not automatically attribute revenue. For an amount to be evaluated as attributed revenue, the event must include a positive monetary amount, currency, an identifiable customer or session, and evidence that meets the attribution rules. + +### Mark as important + +Use this option when a new occurrence needs immediate attention. Hellotext can prioritize the related conversation in Inbox when it occurs. + +Do not mark all activity as important. Reserve this option for events that genuinely require an operational response, such as an urgent request or a failure that a person must review. + +## Create actions through the API + +You can manage custom actions with the [Actions API](https://www.hellotext.com/api#actions). Authenticate requests with a token created for the business and use the action endpoints to create, list, retrieve, update, or delete definitions. + +Creating an action requires at least a tracking name. You can also send a readable title and the conversion or importance configuration. If the plan does not support custom actions, the API rejects the request. + +Creating the definition does not track an event. You must then send each occurrence to the event endpoint using the exact action name. + +## Track events from the browser + +Install and initialize [Hellotext.js](https://github.com/hellotext/hellotext.js) before using the action. + +```javascript +const response = await Hellotext.track('appointment.booked') + +if (response.failed) { + console.error(response.data) +} +``` + +You can include general event data: + +```javascript +await Hellotext.track('appointment.booked', { + amount: 45, + currency: 'USD', + tracked_at: 1786032000, +}) +``` + +Hellotext.js includes the current URL and browser session. Once the customer has been identified, it also keeps that identity in subsequent calls. If the customer is still anonymous, the event remains associated with the session and can be connected to the customer when Hellotext receives a valid identification. + +Do not send secrets, payment information, or unnecessary personal data in event parameters. + +## Track events from your backend + +Use the [tracking API](https://www.hellotext.com/api#tracking) when the activity occurs in a CRM, point of sale, mobile app, server process, or another system where the customer's browser does not participate. + +1. Create an authorization token in Hellotext. +2. Confirm that the custom action already exists. +3. Identify the corresponding customer profile or session. +4. Send the exact action name and event parameters. +5. Keep the response and any request identifier for troubleshooting. + +To decide between a customer profile and session, read [External tracking]({% link _developers/external-tracking.md %}). Never expose the authorization token in code that runs in the browser. + +## Associate an object when needed + +A custom action does not need an object to be tracked. You can add one when the occurrence should keep structured context. + +For example, `appointment.booked` can point to an existing appointment or create a new instance while tracking the event. Follow [Objects]({% link _developers/objects.md %}) to design the structure and choose between an existing identifier and new object parameters. + +Do not turn all context into an object. Use one when that entity needs its own identity, reusable properties, or more events throughout its lifecycle. + +## Record one occurrence manually + +For a one-time case: + +1. Open the customer profile in **Audience**. +2. Select **New Event**. +3. Choose the custom action. +4. Enter the date, amount, URL, or object when applicable. +5. Save the event. + +This records one occurrence. It does not configure automatic tracking for future events. + +## Use the action in Hellotext + +After testing it, a custom action can be used to: + +- start a journey when the event occurs; +- build segments from customer activity; +- show context in the customer profile; +- measure custom conversions; and +- help compatible playbooks interpret business signals. + +Test first with a controlled customer profile. Confirm that the event appears in its activity before activating journeys, segments, or reports that depend on it. + +## Avoid duplicate events + +Define one primary source for each action. Do not track the same occurrence from Hellotext.js, your backend, and a connected integration at the same time. + +Keep the source operation identifier in your system and track the event once. If a request has an uncertain result, check whether the event already appears before retrying it. + +## Edit or delete an action + +You can change its readable name, tracking name, and configuration. Changing the tracking name requires updating every source and dependency. + +Treat deletion as a destructive operation. Hellotext warns that it can affect associated events and cannot be undone; the API may also reject deletion when tracked events already exist. Before deleting the action, review journeys, segments, reports, and integrations, then stop every source that still sends the event. + +## Troubleshoot issues + +| Issue | What to check | +| --- | --- | +| The action does not appear | Plan, permissions, selected business, and the **Custom** tab. | +| The API says it cannot find the action | The action must exist and the tracking name must match exactly. | +| The event appears on the wrong profile | Customer profile identifier, session, and identity implementation. | +| The event does not start a journey | Journey status, action selected as its trigger, and applicable filters. | +| It does not appear as a conversion | **Mark as conversion**, report period, and attribution rules. | +| It appears more than once | Duplicate sources, browser or backend retries, and manual events. | + +For broader diagnosis, use [Troubleshoot missing signals or activity]({% link _troubleshooting-deliverability/troubleshoot-missing-signals-or-activity.md %}). + +## Related guides + +- [Tracking events]({% link _developers/tracking-events.md %}) +- [Tracking unidentified customers]({% link _developers/tracking-unidentified-customers.md %}) +- [External tracking]({% link _developers/external-tracking.md %}) +- [Custom properties and events]({% link _audience/custom-properties-and-events.md %}) +- [Objects]({% link _developers/objects.md %}) +- [What are signals?]({% link _journeys/what-are-signals.md %}) +- [How we attribute sales]({% link _analytics-reporting-attribution/sales-attribution.md %}) diff --git a/_i18n/en/developers/developers-overview.md b/_i18n/en/developers/developers-overview.md index 37db0700..f76cd0b1 100644 --- a/_i18n/en/developers/developers-overview.md +++ b/_i18n/en/developers/developers-overview.md @@ -2,12 +2,13 @@ Use the developer guides when you need to connect Hellotext with your own site, If you are connecting a custom store without a native integration, start with [Integrate a custom store with Hellotext]({% link _developers/custom-store-integration.md %}). It puts profiles, properties, products, historical orders, Hellotext.js, identity, and server-side tracking in the correct implementation order. -Most developer work in Hellotext falls into five areas: +Most developer work in Hellotext falls into six areas: - Integrating a custom store from end to end. - Reading the API reference. - Sending messages from your own system. - Tracking customer activity. +- Defining business-specific actions and objects. - Connecting unidentified sessions to customer profiles. ## Custom store integration @@ -48,6 +49,12 @@ Tracked events can help you segment audiences, trigger playbooks or routes, attr Keep reading: [Tracking events]({% link _developers/tracking-events.md %}). +## Model business-specific activity + +Use custom actions to name activity that Hellotext does not include by default. Use objects when that activity involves a reusable entity with its own properties and lifecycle. + +Keep reading: [Custom actions]({% link _developers/custom-actions.md %}) and [Objects]({% link _developers/objects.md %}). + ## Connect browser sessions to customer profiles Hellotext.js can create a session for unidentified visitors. When the visitor becomes known, you can attach that session to a customer profile so earlier activity is preserved. diff --git a/_i18n/en/developers/objects.md b/_i18n/en/developers/objects.md new file mode 100644 index 00000000..13c7c7a4 --- /dev/null +++ b/_i18n/en/developers/objects.md @@ -0,0 +1,186 @@ +Objects give structure and identity to the entities involved in customer activity. A product viewed, an order placed, or an appointment booked becomes more useful when the event points to the specific product, order, or appointment involved. + +Hellotext includes built-in object structures for common entities. You can create a custom structure when your business needs another kind of entity. + +## Understand structure, instance, and event + +These three concepts work together: + +- An **object structure** defines the type of entity and its properties. For example, `appointment` with reference, room, and scheduled date. +- An **object instance** is one specific entity that follows that structure. For example, appointment `APT-1042` in room 3. +- An **event** records something that happened and can point to the instance. For example, `appointment.booked` for that appointment and customer. + +The structure is reusable. Instances retain context, while events build the history of what happened over time. + +## Use the right data model + +Use an object when the entity needs its own identity, properties, and potentially several events during its lifecycle. + +Use a customer profile property when a value describes the customer's current state, such as preferred store or membership tier. Use an event without an object when recording the occurrence is enough and there is no separate entity to preserve. + +For example: + +| Need | Recommended model | +| --- | --- | +| Store the customer's preferred location | Customer profile property | +| Record that an appointment was booked | Event | +| Keep the appointment reference, room, date, and later status changes | Object associated with events | + +## Reuse built-in objects + +Hellotext already includes structures for: + +- apps; +- carts; +- forms; +- locations; +- orders; +- products; and +- refunds. + +Connected eCommerce platforms and Hellotext tracking use these structures to preserve their expected meaning. Add properties to a built-in object when you need more context, but do not create a custom replacement for a product, order, cart, or another equivalent built-in object. + +Built-in names cannot be changed and their structures cannot be deleted. + +## Create a custom object structure + +You need a compatible plan and permissions to create custom object structures. + +1. Open **Settings**. +2. Select **Objects**. +3. Click **Create new object structure**. +4. Enter the display name, such as **Appointments**. +5. Enter a stable singular name, such as `appointment`. +6. Add the properties every instance can contain. +7. Save the structure. + +The display name identifies the object for your team. The singular name is the technical identifier used by the API and event tracking. Keep it stable and avoid creating another structure with the same meaning. + +## Design the properties + +Add only the fields that describe the object itself. Depending on the available property type, you can model text, numbers, dates, times, yes-or-no values, lists, money, URLs, payment methods, and sales channels. + +For each property, decide whether it should be: + +- **Required:** every instance must provide a value. +- **Unique:** the same value cannot belong to more than one instance of that object. +- **Optional:** an instance can exist without the value. + +Use a unique property for a stable external identifier such as an appointment reference, membership number, or service ticket ID. Do not mark fields like status or category as unique. + +You can reorder properties. For custom objects, put the value that best identifies each instance first because Hellotext uses the first property as its main label in the object list. + +## Inherit an event amount + +When an object has money properties, you can choose one as the inherited amount. If an activity is tracked for that object without an explicit amount, Hellotext uses the value of that property as the event amount. + +Only one money property can be selected for this behavior. Use it when the object's value consistently represents the amount of its events. Send an explicit event amount when the transaction amount can differ from the stored value. + +## Create and manage instances + +An object structure must have at least one property before you can create instances from Hellotext. + +1. Go to **Settings > Objects**. +2. Open the structure you want to manage. +3. Click **Create new** followed by the object name. +4. Complete every required property and the optional context you need. +5. Save the instance. + +From the same list, you can edit or delete an instance. Deleting it cannot be undone and can remove the context associated with its events, so confirm that integrations and tracking no longer depend on it. + +## Create a structure through the API + +Use the [Objects API](https://www.hellotext.com/api#objects) to list built-in and custom structures or to create and manage custom ones. + +A new structure needs a display title, a singular name, and its property definitions. For example: + +```json +{ + "title": "Appointments", + "name": "appointment", + "properties": [ + { + "kind": "text", + "name": "reference", + "required": true, + "unique": true + }, + { + "kind": "text", + "name": "room", + "required": false, + "unique": false + } + ] +} +``` + +Authenticate with a token for the business. Use the IDs returned for the structure and properties when another API operation accepts them. Check the API reference for the supported property kinds and the complete request and response formats. + +## Associate an object while tracking + +When tracking a custom action through the API, identify the structure with `object_type`. Use the singular name, such as `appointment`, or the structure ID. + +Then choose one of these approaches: + +- Send `object` with the ID of an existing instance. +- Send `object_parameters` to create a new instance with the event. + +To create a new instance while tracking: + +```json +{ + "action": "appointment.booked", + "profile": "CUSTOMER_PROFILE_ID", + "object_type": "appointment", + "object_parameters": { + "reference": "APT-1042", + "room": "Room 3" + } +} +``` + +To associate an existing instance instead: + +```json +{ + "action": "appointment.confirmed", + "profile": "CUSTOMER_PROFILE_ID", + "object_type": "appointment", + "object": "OBJECT_INSTANCE_ID" +} +``` + +Use property names inside `object_parameters`, or `property_by_id` when your integration stores the property IDs. Required and unique rules are validated when Hellotext creates the instance. + +Do not send `object_parameters` repeatedly for the same unique entity. Store or recover the existing instance ID and use `object` for later events in its lifecycle. + +## Update a structure carefully + +Adding an optional property does not require existing instances to have a value. Adding a required property means new and edited instances need that value, so prepare the source data first. + +Changing a singular name or property name requires updating every integration and tracking request that sends it. Reordering properties changes their presentation, while changing or deleting them can affect data already stored. + +Deleting a custom structure removes its associated instances and data and cannot be undone. Stop tracking it and review dependent actions, routes, segments, and integrations first. + +## Troubleshoot objects + +| Issue | What to check | +| --- | --- | +| You cannot create a structure | Plan, permissions, active subscription, and selected business. | +| You cannot create an instance | The structure must contain at least one property. | +| The API reports a duplicate value | A property marked as unique already uses that value. | +| A required property fails validation | Send a non-empty value in the format expected by its property kind. | +| The event cannot find the object type | Use the exact singular name or structure ID from **Settings > Objects**. | +| The event cannot find the instance | Confirm the instance ID belongs to that structure and business. | +| The object list is hard to scan | Move the most recognizable property to the first position. | + +For missing activity after tracking, use [Troubleshoot missing signals or activity]({% link _troubleshooting-deliverability/troubleshoot-missing-signals-or-activity.md %}). + +## Related guides + +- [Custom actions]({% link _developers/custom-actions.md %}) +- [Tracking events]({% link _developers/tracking-events.md %}) +- [External tracking]({% link _developers/external-tracking.md %}) +- [Custom properties and events]({% link _audience/custom-properties-and-events.md %}) +- [What are signals?]({% link _journeys/what-are-signals.md %}) diff --git a/_i18n/en/developers/tracking-events.md b/_i18n/en/developers/tracking-events.md index c14fdc2d..fd8e8b9e 100644 --- a/_i18n/en/developers/tracking-events.md +++ b/_i18n/en/developers/tracking-events.md @@ -104,6 +104,8 @@ Do not generate a new name for each customer, order, or date. An action represen The custom action must exist before you track the first event. See [Create an action](https://www.hellotext.com/api#create_an_action). +To define the name, track occurrences, and use the action in journeys or reports, read [Custom actions]({% link _developers/custom-actions.md %}). + A custom event with a positive monetary amount can be evaluated for attribution when Hellotext identifies the customer and finds eligible source and timing evidence. Creating the action does not automatically turn its amount into attributed revenue. See [How we attribute sales]({% link _analytics-reporting-attribution/sales-attribution.md %}). ## How events reach Hellotext @@ -161,6 +163,8 @@ If events do not appear where expected, use [Troubleshoot missing signals or act - [What are signals?]({% link _journeys/what-are-signals.md %}) - [Integrate a custom store with Hellotext]({% link _developers/custom-store-integration.md %}) +- [Custom actions]({% link _developers/custom-actions.md %}) +- [Objects]({% link _developers/objects.md %}) - [External tracking]({% link _developers/external-tracking.md %}) - [Custom properties and events]({% link _audience/custom-properties-and-events.md %}) - [How we attribute sales]({% link _analytics-reporting-attribution/sales-attribution.md %}) diff --git a/_i18n/es/audience/custom-properties-and-events.md b/_i18n/es/audience/custom-properties-and-events.md index 0cfeec8e..c3b9e3cc 100644 --- a/_i18n/es/audience/custom-properties-and-events.md +++ b/_i18n/es/audience/custom-properties-and-events.md @@ -97,6 +97,8 @@ Marcar una acción como conversión permite que los reportes traten sus eventos Trata el nombre de tracking como un contrato con tu sitio, backend e integraciones. Si lo cambias, actualiza cada fuente que envía el evento. Eliminar una acción personalizada también elimina sus eventos asociados y no se puede deshacer. +Consulta [Acciones personalizadas]({% link _developers/custom-actions.md %}) para ver el flujo completo de configuración, tracking, objetos y solución de problemas. + ## Registra y revisa eventos Los eventos pueden llegar automáticamente desde una tienda conectada, captura, conversación, Hellotext.js, API o integración personalizada. @@ -150,5 +152,6 @@ Antes de depender de una propiedad o evento personalizado: - [Crea segmentos]({% link _audience/segments.md %}) - [Etiquetas de personalización]({% link _audience/personalization-tags.md %}) - [Qué son las señales]({% link _journeys/what-are-signals.md %}) +- [Acciones personalizadas]({% link _developers/custom-actions.md %}) - [Seguimiento de eventos]({% link _developers/tracking-events.md %}) - [Verifica tus datos y señales después de configurar]({% link _integrations/verify-data-and-signals.md %}) diff --git a/_i18n/es/developers/custom-actions.md b/_i18n/es/developers/custom-actions.md new file mode 100644 index 00000000..27f0f6f2 --- /dev/null +++ b/_i18n/es/developers/custom-actions.md @@ -0,0 +1,165 @@ +Una acción personalizada define una actividad propia de tu negocio que Hellotext no incluye entre sus acciones preestablecidas. Por ejemplo, puedes definir `appointment.booked`, `loyalty.reward_redeemed` o `physical_store.payment_completed`. + +La acción es la definición reutilizable. Cada vez que esa actividad ocurre, registras un **evento** con el nombre de tracking de la acción. Hellotext puede usar esos eventos como señales en el perfil del cliente, segmentos, rutas, reportes y otras funciones compatibles. + +## Antes de crear una acción + +Revisa primero las acciones preestablecidas en **Ajustes > Acciones**. Hellotext ya incluye actividades comunes de eCommerce, mensajes, formularios, suscripciones y conversaciones. + +Usa una acción personalizada cuando necesitas registrar algo que ocurrió en un momento específico y no existe una acción equivalente. Usa una propiedad del perfil del cliente cuando el dato describe un estado actual que puede cambiar, como nivel de fidelidad, tienda preferida o fecha de renovación. + +No crees otra acción para reemplazar `order.placed`, `product.viewed` o una actividad preestablecida equivalente. Los playbooks y reportes pueden depender del significado y del objeto asociado a la acción original. + +## Crea una acción desde Hellotext + +Necesitas un plan y permisos que admitan acciones personalizadas. + +1. Abre **Ajustes**. +2. Selecciona **Acciones**. +3. Abre la pestaña **Personalizado**. +4. Haz clic en **Crear nueva acción**. +5. Completa el nombre legible y el nombre de tracking. +6. Decide si debe marcarse como conversión o como importante. +7. Guarda la acción. + +El **nombre legible** es la etiqueta que verá tu equipo en Hellotext. El **nombre de tracking** es el identificador exacto que deben enviar tu sitio, backend e integraciones. + +## Elige un nombre de tracking estable + +Usa minúsculas y separa el objeto de la actividad con un punto. Por ejemplo: + +- `appointment.booked` +- `membership.renewed` +- `quote.requested` +- `store_visit.completed` + +Cada nombre de tracking debe ser único dentro del negocio y no puede usar el nombre de una acción preestablecida. + +Trátalo como un contrato técnico. Si cambias `appointment.booked` por `appointment.scheduled`, también debes actualizar cada sitio, backend, integración, segmento o ruta que usa el nombre anterior. + +## Configura su efecto + +### Marcar como conversión + +Usa esta opción cuando una ocurrencia representa un resultado que quieres ver como conversión en los reportes compatibles. + +Marcar la acción no atribuye automáticamente ingresos. Para evaluar un monto como ingreso atribuido, el evento debe incluir un monto monetario positivo, moneda, cliente o sesión identificable y evidencia que cumpla las reglas de atribución. + +### Marcar como importante + +Usa esta opción cuando una nueva ocurrencia requiere atención inmediata. Hellotext puede priorizar la conversación relacionada en el Inbox cuando ocurre. + +No marques toda la actividad como importante. Reserva esta opción para eventos que realmente requieren una respuesta operativa, como una solicitud urgente o un fallo que debe revisar una persona. + +## Crea acciones mediante la API + +Puedes administrar acciones personalizadas con la [API de Acciones](https://www.hellotext.com/api#actions). Autentica las solicitudes con un token creado para el negocio y usa los endpoints de acciones para crear, listar, obtener, actualizar o eliminar definiciones. + +La creación necesita al menos un nombre de tracking. También puedes enviar un título legible y la configuración de conversión o importancia. Si el plan no admite acciones personalizadas, la API rechazará la creación. + +Crear la definición no registra un evento. Después debes enviar cada ocurrencia al endpoint de eventos usando el nombre exacto de la acción. + +## Registra eventos desde el navegador + +Instala e inicializa [Hellotext.js](https://github.com/hellotext/hellotext.js) antes de usar la acción. + +```javascript +const response = await Hellotext.track('appointment.booked') + +if (response.failed) { + console.error(response.data) +} +``` + +Puedes incluir datos generales del evento: + +```javascript +await Hellotext.track('appointment.booked', { + amount: 45, + currency: 'USD', + tracked_at: 1786032000, +}) +``` + +Hellotext.js incorpora la URL actual y la sesión del navegador. Cuando el cliente ya fue identificado, también conserva esa identidad en las llamadas posteriores. Si todavía es anónimo, el evento queda asociado a la sesión y puede relacionarse con el cliente cuando Hellotext recibe una identificación válida. + +No envíes secretos, información de pago ni datos personales innecesarios dentro de los parámetros del evento. + +## Registra eventos desde tu backend + +Usa la [API de tracking](https://www.hellotext.com/api#tracking) cuando la actividad ocurre en un CRM, punto de venta, aplicación móvil, proceso de servidor u otro sistema donde el navegador del cliente no participa. + +1. Crea un token de autorización en Hellotext. +2. Confirma que la acción personalizada ya existe. +3. Identifica el perfil del cliente o la sesión correspondiente. +4. Envía el nombre exacto de la acción y los parámetros del evento. +5. Conserva la respuesta y cualquier identificador de solicitud para diagnosticar errores. + +Para decidir entre perfil del cliente y sesión, consulta [Seguimiento de origen externo]({% link _developers/external-tracking.md %}). No expongas el token de autorización en código que se ejecuta en el navegador. + +## Asocia un objeto cuando haga falta + +Una acción personalizada no necesita un objeto para poder registrarse. Puedes agregar uno cuando la ocurrencia debe conservar contexto estructurado. + +Por ejemplo, `appointment.booked` puede apuntar a una cita existente o crear una nueva instancia al registrar el evento. Consulta [Objetos]({% link _developers/objects.md %}) para diseñar la estructura y elegir entre un identificador existente y los parámetros de un objeto nuevo. + +No conviertas todo el contexto en un objeto. Úsalo cuando esa entidad necesita identidad propia, propiedades reutilizables o más eventos a lo largo de su ciclo de vida. + +## Registra una ocurrencia manual + +Para un caso puntual: + +1. Abre el perfil del cliente en **Audiencia**. +2. Selecciona **Nuevo Evento**. +3. Elige la acción personalizada. +4. Completa la fecha, monto, URL u objeto cuando corresponda. +5. Guarda el evento. + +Esto registra una sola ocurrencia. No configura el tracking automático de eventos futuros. + +## Usa la acción en Hellotext + +Después de probarla, una acción personalizada puede servir para: + +- iniciar una ruta cuando ocurre el evento; +- crear segmentos a partir de la actividad del cliente; +- mostrar contexto en el perfil del cliente; +- medir conversiones personalizadas; y +- ayudar a playbooks compatibles a interpretar señales del negocio. + +Prueba primero con un perfil del cliente controlado. Confirma que el evento aparece en su actividad antes de activar rutas, segmentos o reportes que dependan de él. + +## Evita eventos duplicados + +Define una fuente principal para cada acción. No registres la misma ocurrencia desde Hellotext.js, tu backend y una integración conectada al mismo tiempo. + +Conserva en tu sistema el identificador de la operación de origen y registra el evento una sola vez. Si una solicitud queda en estado incierto, revisa si el evento ya aparece antes de repetirla. + +## Edita o elimina una acción + +Puedes cambiar su nombre legible, nombre de tracking y configuración. Cambiar el nombre de tracking requiere actualizar todas sus fuentes y dependencias. + +Trata la eliminación como una operación destructiva. Hellotext advierte que puede afectar eventos asociados y no se puede deshacer; la API también puede rechazar la eliminación cuando ya existen eventos registrados. Antes de eliminarla, revisa rutas, segmentos, reportes e integraciones y detén primero todas las fuentes que todavía envían el evento. + +## Soluciona problemas + +| Problema | Qué revisar | +| --- | --- | +| La acción no aparece | Plan, permisos, negocio seleccionado y pestaña **Personalizado**. | +| La API devuelve que no encuentra la acción | La acción debe existir y el nombre de tracking debe coincidir exactamente. | +| El evento está en el perfil equivocado | Identificador del perfil del cliente, sesión e implementación de identidad. | +| El evento no inicia una ruta | Estado de la ruta, acción configurada como disparador y filtros aplicables. | +| No aparece como conversión | Opción **Marcar como conversión**, período del reporte y reglas de atribución. | +| Aparece más de una vez | Fuentes duplicadas, reintentos del cliente o backend y eventos manuales. | + +Para un diagnóstico más amplio, usa [Soluciona señales o actividad faltante]({% link _troubleshooting-deliverability/troubleshoot-missing-signals-or-activity.md %}). + +## Guías relacionadas + +- [Seguimiento de eventos]({% link _developers/tracking-events.md %}) +- [Seguimiento de clientes no identificados]({% link _developers/tracking-unidentified-customers.md %}) +- [Seguimiento de origen externo]({% link _developers/external-tracking.md %}) +- [Propiedades y eventos personalizados]({% link _audience/custom-properties-and-events.md %}) +- [Objetos]({% link _developers/objects.md %}) +- [Qué son las señales]({% link _journeys/what-are-signals.md %}) +- [Cómo atribuimos las ventas]({% link _analytics-reporting-attribution/sales-attribution.md %}) diff --git a/_i18n/es/developers/developers-overview.md b/_i18n/es/developers/developers-overview.md index e7355228..4dfbaa2d 100644 --- a/_i18n/es/developers/developers-overview.md +++ b/_i18n/es/developers/developers-overview.md @@ -2,12 +2,13 @@ Usa las guías para desarrolladores cuando necesites conectar Hellotext con tu s Si vas a conectar una tienda propia sin una integración nativa, comienza con [Integra una tienda propia con Hellotext]({% link _developers/custom-store-integration.md %}). Presenta perfiles, propiedades, productos, pedidos históricos, Hellotext.js, identidad y seguimiento desde el servidor en el orden de implementación correcto. -La mayoría del trabajo técnico con Hellotext cae en cinco áreas: +La mayoría del trabajo técnico con Hellotext cae en seis áreas: - Integrar una tienda propia de principio a fin. - Leer la referencia de la API. - Enviar mensajes desde tu propio sistema. - Registrar actividad de clientes. +- Definir acciones y objetos específicos del negocio. - Conectar sesiones no identificadas con perfiles de clientes. ## Integración de una tienda propia @@ -48,6 +49,12 @@ Los eventos rastreados pueden ayudarte a segmentar audiencias, activar playbooks Sigue leyendo: [Seguimiento de eventos]({% link _developers/tracking-events.md %}). +## Modela actividad específica del negocio + +Usa acciones personalizadas para nombrar actividad que Hellotext no incluye de forma preestablecida. Usa objetos cuando esa actividad involucra una entidad reutilizable con propiedades y ciclo de vida propios. + +Sigue leyendo: [Acciones personalizadas]({% link _developers/custom-actions.md %}) y [Objetos]({% link _developers/objects.md %}). + ## Conecta sesiones del navegador con perfiles de clientes Hellotext.js puede crear una sesión para visitantes no identificados. Cuando el visitante se identifica, puedes adjuntar esa sesión a un perfil del cliente para conservar la actividad anterior. diff --git a/_i18n/es/developers/objects.md b/_i18n/es/developers/objects.md new file mode 100644 index 00000000..43bfb81b --- /dev/null +++ b/_i18n/es/developers/objects.md @@ -0,0 +1,186 @@ +Los objetos dan estructura e identidad a las entidades involucradas en la actividad del cliente. Un producto visto, una orden creada o una cita reservada resulta más útil cuando el evento apunta al producto, orden o cita específicos. + +Hellotext incluye estructuras de objetos preestablecidas para entidades comunes. Puedes crear una estructura personalizada cuando tu negocio necesita representar otro tipo de entidad. + +## Comprende estructura, instancia y evento + +Estos tres conceptos funcionan en conjunto: + +- Una **estructura de objeto** define el tipo de entidad y sus propiedades. Por ejemplo, `appointment` con referencia, sala y fecha programada. +- Una **instancia de objeto** es una entidad específica que sigue esa estructura. Por ejemplo, la cita `APT-1042` en la sala 3. +- Un **evento** registra algo que ocurrió y puede apuntar a la instancia. Por ejemplo, `appointment.booked` para esa cita y ese cliente. + +La estructura es reutilizable. Las instancias conservan el contexto y los eventos construyen el historial de lo que ocurrió a lo largo del tiempo. + +## Usa el modelo de datos correcto + +Usa un objeto cuando la entidad necesita identidad propia, propiedades y posiblemente varios eventos durante su ciclo de vida. + +Usa una propiedad del perfil del cliente cuando un valor describe el estado actual del cliente, como tienda preferida o nivel de membresía. Usa un evento sin objeto cuando registrar la ocurrencia es suficiente y no hay una entidad separada que necesites conservar. + +Por ejemplo: + +| Necesidad | Modelo recomendado | +| --- | --- | +| Guardar la ubicación preferida del cliente | Propiedad del perfil del cliente | +| Registrar que se reservó una cita | Evento | +| Conservar la referencia, sala, fecha y cambios de estado posteriores de la cita | Objeto asociado con eventos | + +## Reutiliza los objetos preestablecidos + +Hellotext ya incluye estructuras para: + +- aplicaciones; +- carritos; +- formularios; +- ubicaciones; +- órdenes; +- productos; y +- reembolsos. + +Las plataformas de eCommerce conectadas y el tracking de Hellotext usan estas estructuras para conservar el significado esperado. Agrega propiedades a un objeto preestablecido cuando necesites más contexto, pero no crees un reemplazo personalizado para producto, orden, carrito u otro objeto preestablecido equivalente. + +Los nombres preestablecidos no se pueden cambiar y sus estructuras no se pueden eliminar. + +## Crea una estructura de objeto personalizada + +Necesitas un plan y permisos compatibles para crear estructuras de objetos personalizadas. + +1. Abre **Ajustes**. +2. Selecciona **Objetos**. +3. Haz clic en **Crear nueva estructura de objeto**. +4. Ingresa el nombre visible, como **Citas**. +5. Ingresa un nombre singular estable, como `appointment`. +6. Agrega las propiedades que puede contener cada instancia. +7. Guarda la estructura. + +El nombre visible identifica el objeto para tu equipo. El nombre singular es el identificador técnico que usan la API y el tracking de eventos. Mantenlo estable y evita crear otra estructura con el mismo significado. + +## Diseña las propiedades + +Agrega solamente los campos que describen al objeto. Según el tipo de propiedad disponible, puedes modelar texto, números, fechas, horas, valores de sí o no, listas, dinero, URLs, métodos de pago y canales de venta. + +Para cada propiedad, decide si debe ser: + +- **Requerida:** cada instancia debe proporcionar un valor. +- **Única:** el mismo valor no puede pertenecer a más de una instancia de ese objeto. +- **Opcional:** una instancia puede existir sin ese valor. + +Usa una propiedad única para un identificador externo estable, como la referencia de una cita, número de membresía o ID de un caso de servicio. No marques como únicos campos como estado o categoría. + +Puedes reordenar las propiedades. En los objetos personalizados, coloca primero el valor que mejor identifica cada instancia porque Hellotext usa la primera propiedad como etiqueta principal en la lista de objetos. + +## Hereda el monto de un evento + +Cuando un objeto tiene propiedades de dinero, puedes elegir una como monto heredado. Si se registra una actividad para ese objeto sin un monto explícito, Hellotext usa el valor de esa propiedad como monto del evento. + +Solo una propiedad de dinero puede seleccionarse para este comportamiento. Úsala cuando el valor del objeto representa de forma consistente el monto de sus eventos. Envía un monto explícito en el evento cuando el importe de la transacción pueda ser diferente del valor guardado. + +## Crea y administra instancias + +Una estructura de objeto debe tener al menos una propiedad antes de que puedas crear instancias desde Hellotext. + +1. Ve a **Ajustes > Objetos**. +2. Abre la estructura que quieres administrar. +3. Haz clic en **Crear nuevo** seguido del nombre del objeto. +4. Completa todas las propiedades requeridas y el contexto opcional que necesites. +5. Guarda la instancia. + +Desde la misma lista puedes editar o eliminar una instancia. Eliminarla no se puede deshacer y puede quitar el contexto asociado con sus eventos, por lo que debes confirmar que las integraciones y el tracking ya no dependan de ella. + +## Crea una estructura mediante la API + +Usa la [API de Objetos](https://www.hellotext.com/api#objects) para listar estructuras preestablecidas y personalizadas, o para crear y administrar las personalizadas. + +Una estructura nueva necesita un título visible, un nombre singular y sus definiciones de propiedades. Por ejemplo: + +```json +{ + "title": "Citas", + "name": "appointment", + "properties": [ + { + "kind": "text", + "name": "reference", + "required": true, + "unique": true + }, + { + "kind": "text", + "name": "room", + "required": false, + "unique": false + } + ] +} +``` + +Autentica la solicitud con un token del negocio. Usa los IDs que devuelve para la estructura y las propiedades cuando otra operación de la API los admita. Consulta la referencia de la API para conocer los tipos de propiedades compatibles y los formatos completos de solicitud y respuesta. + +## Asocia un objeto durante el tracking + +Cuando registras una acción personalizada mediante la API, identifica la estructura con `object_type`. Usa el nombre singular, como `appointment`, o el ID de la estructura. + +Después elige uno de estos enfoques: + +- Envía `object` con el ID de una instancia existente. +- Envía `object_parameters` para crear una instancia nueva junto con el evento. + +Para crear una instancia nueva al registrar el evento: + +```json +{ + "action": "appointment.booked", + "profile": "CUSTOMER_PROFILE_ID", + "object_type": "appointment", + "object_parameters": { + "reference": "APT-1042", + "room": "Sala 3" + } +} +``` + +Para asociar una instancia existente: + +```json +{ + "action": "appointment.confirmed", + "profile": "CUSTOMER_PROFILE_ID", + "object_type": "appointment", + "object": "OBJECT_INSTANCE_ID" +} +``` + +Usa los nombres de las propiedades dentro de `object_parameters` o `property_by_id` cuando tu integración conserva los IDs de las propiedades. Hellotext valida las reglas de propiedades requeridas y únicas al crear la instancia. + +No envíes `object_parameters` repetidamente para la misma entidad única. Guarda o recupera el ID de la instancia existente y usa `object` para los eventos posteriores de su ciclo de vida. + +## Actualiza una estructura con cuidado + +Agregar una propiedad opcional no exige que las instancias existentes tengan un valor. Agregar una propiedad requerida implica que las instancias nuevas y editadas necesitan ese valor, por lo que conviene preparar primero los datos de origen. + +Cambiar un nombre singular o el nombre de una propiedad requiere actualizar cada integración y solicitud de tracking que lo envía. Reordenar propiedades cambia su presentación, mientras que modificarlas o eliminarlas puede afectar datos ya guardados. + +Eliminar una estructura personalizada borra sus instancias y datos asociados y no se puede deshacer. Detén primero su tracking y revisa las acciones, rutas, segmentos e integraciones que dependan de ella. + +## Soluciona problemas con objetos + +| Problema | Qué revisar | +| --- | --- | +| No puedes crear una estructura | Plan, permisos, suscripción activa y negocio seleccionado. | +| No puedes crear una instancia | La estructura debe contener al menos una propiedad. | +| La API informa un valor duplicado | Una propiedad marcada como única ya usa ese valor. | +| Una propiedad requerida falla la validación | Envía un valor no vacío con el formato que espera su tipo de propiedad. | +| El evento no encuentra el tipo de objeto | Usa el nombre singular exacto o el ID de la estructura que aparece en **Ajustes > Objetos**. | +| El evento no encuentra la instancia | Confirma que el ID de la instancia pertenece a esa estructura y negocio. | +| La lista de objetos es difícil de revisar | Mueve la propiedad más reconocible a la primera posición. | + +Si falta actividad después del tracking, consulta [Soluciona señales o actividad faltante]({% link _troubleshooting-deliverability/troubleshoot-missing-signals-or-activity.md %}). + +## Guías relacionadas + +- [Acciones personalizadas]({% link _developers/custom-actions.md %}) +- [Seguimiento de eventos]({% link _developers/tracking-events.md %}) +- [Seguimiento de origen externo]({% link _developers/external-tracking.md %}) +- [Propiedades y eventos personalizados]({% link _audience/custom-properties-and-events.md %}) +- [Qué son las señales]({% link _journeys/what-are-signals.md %}) diff --git a/_i18n/es/developers/tracking-events.md b/_i18n/es/developers/tracking-events.md index 213fdeb8..b4ae3119 100644 --- a/_i18n/es/developers/tracking-events.md +++ b/_i18n/es/developers/tracking-events.md @@ -104,6 +104,8 @@ No generes un nombre nuevo por cliente, pedido o fecha. Una acción representa u La acción personalizada debe existir antes de registrar el primer evento. Consulta [Crear una acción](https://www.hellotext.com/api#create_an_action). +Para definir el nombre, registrar ocurrencias y usar la acción en rutas o reportes, consulta [Acciones personalizadas]({% link _developers/custom-actions.md %}). + Un evento personalizado con un monto monetario positivo puede evaluarse para atribución cuando Hellotext identifica al cliente y encuentra evidencia elegible de origen y tiempo. Crear la acción no convierte automáticamente su monto en ingresos atribuidos. Consulta [Cómo atribuimos las ventas]({% link _analytics-reporting-attribution/sales-attribution.md %}). ## Cómo llegan los eventos a Hellotext @@ -161,6 +163,8 @@ Si los eventos no aparecen donde esperas, usa [Soluciona señales o actividad fa - [Qué son las señales]({% link _journeys/what-are-signals.md %}) - [Integra una tienda propia con Hellotext]({% link _developers/custom-store-integration.md %}) +- [Acciones personalizadas]({% link _developers/custom-actions.md %}) +- [Objetos]({% link _developers/objects.md %}) - [Seguimiento de origen externo]({% link _developers/external-tracking.md %}) - [Propiedades y eventos personalizados]({% link _audience/custom-properties-and-events.md %}) - [Cómo atribuimos las ventas]({% link _analytics-reporting-attribution/sales-attribution.md %})