WoowUp Developer Docs
Woowup
  • Getting Started (EN)
  • Primeros Pasos (ES)
  • API
    • Users
    • Purchases
    • Products
    • Benefits
    • Coupons
    • Events
      • Garantía Extendida
    • Custom Attributes
    • Branches
    • Blacklist
    • Abandoned carts
    • Reset account
    • Integration Stats
    • Categories
    • Segment Export
  • Web Tracking
    • Configuración Navegación Web
  • Push Notifications
    • Configuración Notificaciones Web Push en Magento / Web Custom
    • Configuración Push en VTEX Legacy
    • Configuración Push en VTEX IO
    • ¿Cómo saber si la configuración fue exitosa?
  • Formularios Web
    • Formulario HTML / Script JS Newsletter
  • VTEX
    • Conectar Cuenta
    • Trigger Carrito Abandonado
    • Trigger Newsletter
    • VTEX APP Instalación
    • VTEX APP Configuración
  • Magento 1
    • Conectar Cuenta
    • Extension Carrito Abandonado
  • Magento 2
    • Conectar Cuenta
  • Shopify
    • Conectar Cuenta
  • Woocommerce
    • Conectar Cuenta
    • Extensión Carrito Abandonado
  • Prestashop
    • Conectar Cuenta
  • E3
    • Conecta tu eCommerce E3
  • Tienda Nube
    • Conectar Cuenta
  • Mensajería
    • SendGrid: Conectar Cuenta
    • Perfit: Conectar Cuenta
    • Infobip: Conectar Cuenta
  • Editor de campañas
    • Motor de template de emails
  • Data Processing
    • WoowUp Connectors
    • Migración a Multi - ID
  • How To
    • SurveyKiwi: Conectar Cuenta
      • Untitled
    • Snappy: Conectar Cuenta
    • Zendesk: Conectar Cuenta
  • Integración CSV / SQL
    • Primeros pasos
    • Archivo de Tiendas
    • Archivo de Categorías
    • Archivo de Productos
    • Archivo de Clientes
    • Archivo de Ventas
    • Archivo de Medios de Pago
    • Archivo de Miembros de Familia
  • Validación de Datos
  • ¿Cómo completar el Blueprint?
Powered by GitBook
On this page
  • Cómo enviar contactos a Woowup desde el popup de registro en tu web mediante un script
  • Ejemplo jQuery
  • Parámetros disponibles para enviar
  • HTTP Response Codes
  • Ejemplo funcional jQuery 2.2.4

Was this helpful?

  1. Formularios Web

Formulario HTML / Script JS Newsletter

Cómo enviar contactos a Woowup desde el popup de registro en tu web mediante un script

Si tienes un popup o landing en el cual pides datos a tus usuarios para que se registren al newsletter o a alguna promocion, es posible enviar este usuario a Woowup mediante un llamado simple de AJAX.

Es necesario tener la Clave Pública de tu programa en Woowup. La puedes conseguir con rol de Super-Admin en la parte de configuración.

Ejemplo jQuery

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>My Ecommerce</title>
	<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
	<script>
		var settings = {
			"async": true,
			"crossDomain": true,
			"url": "https://events.woowup.com/events/users",
			"type": "POST",
			"headers": {
				"cache-control": "no-cache",
				"content-type": "application/json"
			},
			"data": JSON.stringify({
				"app": "CLAVE_PUBLICA_WOOWUP",
				"service_uid": "9988776655",
				"document": "1122334455",
				"email": "john@doe.com",
				"tags": "ecommerce,newsletter",
				"birthdate": "1989-06-22",
				"telephone": "+549116655443322",
				"gender": "M",
				"first_name": "John",
				"last_name": "Doe",
				"custom_attributes": {
	                "one_attribute": "one value",
		            "other_attribute": "other value",
	            }
			})
		}

		$.ajax(settings).done(function (response) {
			console.log(response);
		}).fail(function (error){ 
		        console.log(JSON.stringify(error)) 
		});
	</script>
</head>
<body>
</body>
</html>

En el caso de los Custom_attributes tipo FECHA deben ir en formato AAAA-MM-DD

Parámetros disponibles para enviar

Parameter

Required

app

yes

Account identificator

service_uid

No

Customer's identificator

email

No

Customer's email

telephone

No

Customer's telephone

tags

No

Comma separated tags

birthdate

No

Customer's birthday Format: YYYY-MM-DD

gender

No

Customer's gender. Must be "F" or "M"

first_name

No

Customer's first name

last_name

No

Customer's last name

mailing_enabled

No

The user can or can't receive emails. Values: "enabled", "disabled".

mailing_enabled_reason

No

Reason why the user can't receive emails.

sms_enabled

No

The user can or can't receive SMS. Values: "enabled", "disabled".

sms_enabled_reason

No

Reason why the user can't receive SMS.

POST https://api.woowup.com/apiv3/users

Request Body

Name
Type
Description

mailing_enabled

string

The user can or can't receive emails. Values: "enabled", "disabled".

POST https://api.woowup.com/apiv3/users

Request Body

Name
Type
Description

mailing_enabled

string

The user can or can't receive emails. Values: "enabled", "disabled".

HTTP Response Codes

HTTP Code

Name

Description

200

Ok

Everything is ok

400

Bad Request

Invalid parameters

403

forbidden

Account doesn't exist

Ejemplo funcional jQuery 2.2.4

El código "app": "XXXXXX" lo conseguís dentro de Configuración > Claves para desarrolladores. Es necesario tener permiso de super admin para ver las claves.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  crossorigin="anonymous"></script>
</head>
<body>
  <form action="">
    <table>
      <tr>
        <td>Email:</td>
        <td><input type="text" name="email"/></td>
      </tr>
      <tr>
        <td>Nombre:</td>
        <td><input type="text" name="first_name"/></td>
      </tr>
      <tr>
        <td>Apellido:</td>
        <td><input type="text" name="last_name"/></td>
      </tr>
      <tr>
        <td>Como nos encontraste?:</td>
        <td>
          <select name="source">
              <option value="recomendacion">Recomendación</option>
              <option value="via_publica">Publicidad vía pública</option>
              <option value="internet">Publicidad Internet</option>
          </select>
        </td>
      </tr>
      <tr><td colspan=2><button type="button" id="sent">Enviar</button></td></tr>
    </table>
  </form>
  <script>
    $(document).ready(function(){
      $("#sent").click(function(){
        var settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://events.woowup.com/events/users",
              "type": "POST",
              "headers": {
                "cache-control": "no-cache",
                "content-type": "application/json"
              },
              "data": JSON.stringify({
              "app": "CLAVE_PUBLICA_WOOWUP",
              "email": $('input[name=email]').val(),
              "tags": "ecommerce,facebook,pantalon,popup",
              "first_name": $('input[name=first_name]').val(),
              "last_name": $('input[name=last_name]').val(),
              "custom_attributes": {
	                "source": $( "select[name=source]" ).val()
	            }
            })
        }

        $.ajax(settings).done(function (response) {
          console.log(response);
        });
      });

    });
  </script>
</body>
</html>
Previous¿Cómo saber si la configuración fue exitosa?NextConectar Cuenta

Last updated 1 year ago

Was this helpful?