Contenu connexe Similaire à API, SDK e Plugin: raccogliere e integrare i dati, abilitare un profilo consumatore unificato e renderlo disponibile ai sistemi aziendali (20) API, SDK e Plugin: raccogliere e integrare i dati, abilitare un profilo consumatore unificato e renderlo disponibile ai sistemi aziendali1. #SENDSummit17
API, SDK e Plugin:
raccogliere e integrare dati, abilitare un profilo
consumatore unificato e renderlo disponibile ai
sistemi aziendali
Stefano Varesi, Contacthub Technical Lead – Contactlab
Francesco Negri, Senior Software Engineer - buildo
2. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17 2
Un sistema aperto: Contacthub alle fondamenta di una strategia di successo
3. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Contacthub | In a nutshell
3
4. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
La soluzione
4
Contacthub permette di:
collezionare e gestire in un unico punto, tutti i
dati e gli eventi provenienti da diverse fonti in
tempo reale
costruire un singolo profilo cliente
renderlo immediatamente disponibile a tutti i
sistemi aziendali per azioni di marketing e di
business e mettere le basi per un dialogo
personalizzato
5. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Creare una visione unificata del
cliente
Rendere i dati disponibili
immediatamente
Ridurre costi e tempi di
integrazione e gestione
Automatizzare i processi
5
Le sfide
I consumatori interagiscono
con i brand in numerosi modi
Compiono azioni e lasciano
impronte che si traducono in un
mosaico crescente di dati
I dati sono spesso distribuiti su
differenti sistemi aziendali, non
comunicanti tra loro
6. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Cosa fa
6
Selezionate analitiche operative di
acquisizione, composizione e variazione della
base clienti su dati socio-demo e
comportamentali
Analitiche
Raccogliere i dati in modo semplice e
abbattendo tempi e costi
Integrare
Automatizzare azioni (invio email, tag,
webhook) allo scatenarsi di eventiAutomatizzare
Organizzare il formato dei dati, la loro struttura
e aggregazione
Organizzare
7. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Di cosa parliamo oggi
7
Selezionate analitiche operative di
acquisizione, composizione e variazione della
base clienti su dati socio-demo e
comportamentali
Analitiche
Raccogliere i dati in modo semplice e
abbattendo tempi e costi
Integrare
Automatizzare azioni (invio email, tag,
webhook) allo scatenarsi di eventiAutomatizzare
Organizzare il formato dei dati, la loro struttura
e aggregazione
Organizzare
8. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17 8
Integrare | Come cambia lo scenario
Senza
Contacthub
Website App Mobile
CRM
E-
commerce
Analytics
Segmentation Advertising
Email marketing
Website
App
Mobile
CRM
E-
commerc
e
Analytics
Email
marketing
Invio Push
Segmentation
Advertising
Integrazioni ad hoc per ogni fonte
Profili ed eventi diffusi nell’ecosistema
Introduzione e uso di API, SDK, Plug-In
Profili unificati consolidati velocemente
Con
Contacthub
9. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
L’architettura
9
Storage dei dati su MySQL
Indicizzazione su Elasticsearch per ricerche e aggregazioni
10. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
1. Isolamento dei dati dei clienti
10
Cliente 1 Cliente 2 Cliente 3 Cliente n
backend
http rest API http rest API http rest API http rest API
11. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
1. Isolamento dei dati dei clienti
11
Cliente 1 Cliente 2 Cliente 3 Cliente n
backend
http rest API http rest API http rest API http rest API
workspace
12. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
2. Come sono organizzati i dati
12
I clienti scrivono i profili in contenitori
chiamati «nodi entry»
I profili possono essere aggregati in
«nodi view», con politica di
aggregazione configurabile per
creare specifiche viste clienti
Ogni nodo ha propri diritti di accesso
La gerarchia dei nodi è configurabile
Entry
node 3
View
node 2
View
node 1
Entry
node 2
Entry
node 1
13. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17 13
Un caso reale
eCommerce
IT
eCommerce
UK
Subscription
Form
IT
Subscription
Form
UK
CRM
eCommerce
Manager
14. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
API | esempio di utilizzo
14
15. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Cosa vedremo
Configurazione dell’aggregazione
Inserimento un profilo utente
Aggregazione di diversi profili per ottenere una visione unificata
Prerequisiti
Un workspace preconfigurato tramite interfaccia web
15
16. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Cosa vedremo
Configurazione dell’aggregazione
Inserimento un profilo utente
Aggregazione di diversi profili per ottenere una visione unificata
Assegnare eventi al profilo
Prerequisiti
Un workspace preconfigurato tramite interfaccia web
16
17. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Configurazione nodo «Italia»
17
ID del nodo: 102099b5-1464-4e00-a967-14790e9e5c43
18. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Configurazione nodo «UK»
18
ID del nodo: 6cbfc610-32eb-40a0-bd7e-474ce5257d9e
19. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Configurazione nodo vista «Europa»
19
ID del nodo: 6cbfc610-32eb-40a0-bd7e-474ce5257d9e
20. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Configurazione gerarchia
20
21. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Configurazione della Sorgente
21
Sorgente E-commerce Italia
Token:
28f7106a42e1420aa7478b20a1a373d196c0f6b7e36
34c55b9f6c10150cc74a9
Sorgente E-commerce UK
Token:
6359f4457d544c3e8a880c7d85f0f1888a810597701
64f3ea918b0a61f95db53
22. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Risultato
22
ID del workspace: 6ccbbf1d-3fc3-4dff-ae18-7080326155f2
Vista
aggregata
Europa
E-commerce
Italia
E-commerce
UK
Sorgente
dati
Italia
Sorgente
dati UK
23. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Cosa vedremo
Configurazione dell’aggregazione
Inserimento un profilo utente
Aggregazione di diversi profili per ottenere una visione unificata
Assegnare eventi ai profilo
Prerequisiti
Un workspace preconfigurato tramite interfaccia web
23
24. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Creazione profilo 1 | richiesta
24
curl -X POST https://api.contactlab.it/hub/v1/workspaces/6ccbbf1d-3fc3-4dff-ae18-7080326155f2/customers
-H 'authorization: Bearer 28f7106a42e1420aa7478b20a1a373d196c0f6b7e3634c55b9f6c10150cc74a9'
-H 'content-type: application/json'
-d '{
"nodeId": "102099b5-1464-4e00-a967-14790e9e5c43",
"base": {
"firstName": "Luke",
"lastName": "Skywalker",
"gender": "male",
"address": {
"city": "Milano",
"country": "Italia"
},
"contacts": {
"email": "luke.skywalker@example.org"
}
}
}'
Risposta:
201 CREATED
25. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Creazione profilo 2 | richiesta
25
curl -X POST https://api.contactlab.it/hub/v1/workspaces/6ccbbf1d-3fc3-4dff-ae18-7080326155f2/customers
-H 'authorization: Bearer 28f7106a42e1420aa7478b20a1a373d196c0f6b7e3634c55b9f6c10150cc74a9'
-H 'content-type: application/json'
-d '{
"nodeId": "6cbfc610-32eb-40a0-bd7e-474ce5257d9e",
"base": {
"firstName": "Luke",
"lastName": "Skywalker",
"address": {
"city": "London",
"country": "UK"
},
"contacts": {
"email": "luke.skywalker@example.org"
}
}
}'
Risposta:
201 CREATED
26. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Cosa vedremo
Configurazione dell’aggregazione
Inserimento un profilo utente
Aggregazione di diversi profili per ottenere una visione unificata
Assegnare eventi ai profilo
Prerequisiti
Un workspace preconfigurato tramite interfaccia web
26
27. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Profilo aggregato | richiesta
Facciamo la richiesta sul nodo view
L’aggregazione è asincrona: potrebbe esserci un latenza di qualche secondo
27
curl -X GET 'https://api.contactlab.it/hub/v1/workspaces/6ccbbf1d-3fc3-4dff-ae18-7080326155f2/customers?nodeId=dc193021-67b9-
48ea-ab19-9971e343b8c6'
-H 'authorization: Bearer {{oauth2Token}}'
-H 'content-type: application/json'
28. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Profilo aggregato | risposta
28
{
"id": "9a92fe55-ce47-4e63-884b-22285d2f97e3",
"nodeId": "dc193021-67b9-48ea-ab19-9971e343b8c6",
"registeredAt": "2017-06-15T05:33:45.912+0000",
"updatedAt": "2017-06-15T05:33:45.912+0000",
"enabled": true,
"base": {
"firstName": "Luke",
"lastName": "Skywalker",
"gender": "male",
"contacts": {
"email": "luke.skywalker@example.org"
},
"address": {
"city": "London",
"country": "UK"
}
},
"extended": null,
"tags": null
Riconciliazione
Merge dei campi tra i due
profili secondo la regola
di ordinamento
29. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Integrazioni | SDK
29
30. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Integrazioni | Plugin
30
31. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17 31
32. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17 32
Contacthub SDK
33. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Una serie di librerie open source
pubblicate su GitHub
Semplificano l’integrazione tra
l’API e i linguaggi più diffusi
Forniscono documentazione ed
esempi per gli sviluppatori
Knowledge sharing su problemi
e soluzioni che diverse aziende
potrebbero incontrare
separatamente
Accettiamo Pull Request!
Contacthub SDK
33
34. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Maggior livello di astrazione:
nascondono dettagli interni
dell’API
Sviluppate da società esterne,
che più facilmente possono
mettersi nei panni del cliente
La prima parte dell’integrazione
è uguale per tutti: l’abbiamo fatta
noi!
Lo sviluppatore può concentrarsi
sui problemi business-specific
Contacthub SDK: perchè?
34
35. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Compatibile con Node v4 e
seguenti
Disponibile su npm
Unit Tests e Integration Tests
Continuous Integration su
Travis.ci
Scritta in ES6
Promise-based
Flow type annotations
TypeScript (coming soon)
Contacthub SDK Node.js
35
36. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: configurazione
npm install --save contacthub-sdk-nodejs
const ContactHub = require('contacthub-sdk-nodejs');
const ch_it = new ContactHub({
token: 'oauth2_token',
workspaceId: '6ccbbf1d-3fc3-4dff-ae18-7080326155f2',
nodeId: '6cbfc610-32eb-40a0-bd7e-474ce5257d9e'
});
const ch_uk = …
});
const ch_eu = …
});
36
37. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: inserimento di un profilo utente IT
ch_it.addCustomer({
base: {
firstName: 'Luke',
lastName: 'Skywalker',
address: {
city: 'Milano',
country: 'Italia'
},
contacts: {
email: 'luke.skywalker@example.org'
}
}
}).then(customer => console.log(customer));
37
{ id: 'cae82e50-fd89-4cf8-9091-b4cbf2fb45f7',
registeredAt: 2017-06-21T15:37:33.488Z,
updatedAt: 2017-06-21T15:37:33.488Z,
base:
{ firstName: 'Luke',
lastName: 'Skywalker',
contacts: { email: 'luke.skywalker@example.org' },
address: { city: 'Milano', country: 'Italia' } } }
38. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: inserimento di un profilo utente UK
ch_uk.addCustomer({
base: {
firstName: 'Luke',
lastName: 'Skywalker',
address: {
city: 'London',
country: 'UK'
},
contacts: {
email: 'luke.skywalker@example.org'
}
}
}).then(customer => console.log(customer));
38
{ id: 'cae82e50-fd89-4cf8-9091-b4cbf2fb45f7',
registeredAt: 2017-06-21T15:37:33.488Z,
updatedAt: 2017-06-21T15:53:21.254Z,
base:
{ firstName: 'Luke',
lastName: 'Skywalker',
contacts: { email: 'luke.skywalker@example.org' },
address: { city: 'London', country: 'UK' } } }
39. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: ricerca profilo aggregato (EU)
{ page:
{ current: 0,
prev: [Function: prev],
next: [Function: next],
total: 1 },
elements:
[ { id: 'cae82e50-fd89-4cf8-9091-b4cbf2fb45f7',
registeredAt: 2017-06-21T15:37:33.488Z,
updatedAt: 2017-06-21T15:53:21.254Z,
base:
{ firstName: 'Luke',
lastName: 'Skywalker',
contacts: { email: 'luke.skywalker@example.org' },
address: { city: 'London', country: 'UK' }
} ] }
39
const query = ch_eu.createQuery(
'base.contacts.email',
'EQUALS',
'luke.skywalker@example.org’
);
ch_eu.getCustomers({ query })
.then(customers => console.log(customers));
40. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: inserimento evento
ch.addEvent({
customerId: 'cae82e50-fd89-4cf8-9091-b4cbf2fb45f7',
context: 'WEB',
type: 'viewedPage',
properties: {
title: 'Page Title',
url: 'http://www.example.com’
}
});
40
41. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
SDK Node.js: type annotations
41
42. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Ancora più semplice!
Interamente lato client (come
Google Analytics)
Permette di inviare eventi
(pageviews, ricerche, acquisti,
etc.)
Può creare e aggiornare i profili
utente
Riconosce automaticamente id
contactlab se inserito in query
string
Browser SDK
42
44. è un evento organizzato da
© Copyright 2017 Contactlab This document may not be modified, organized or reutilized in any way without the express written permission of the rightful owner.
#SENDSummit17
Integrazione semplificata con
sorgenti dati esterne e sistemi
esterni
Near Real-Time data
propagation
Import, Enrichment, Activation,
feedbacks
Semplicità e velocità utilizzo
Ecosistema di SDK e Plugin
TAKE AWAY
44