TOTAL INSCRIÇÕES
0
↑ 0% este mês
NOTIFICAÇÕES
0
TAXA DE ENTREGA
0%
CTR MÉDIO
0%
📈 Desempenho das Últimas Notificações
| TÍTULO | DATA | IMPRESSÕES | CLIQUES | CTR |
|---|---|---|---|---|
| Carregando... | ||||
Envio Rápido
📍 Distribuição Geográfica
Carregando...
Nova Notificação Push
Sugestões de Templates
Biblioteca de Templates
| DATA | TÍTULO | MENSAGEM | ALVO | ENVIADAS | SUCESSO | IMPRESSÕES | CLIQUES | CTR |
|---|
| ID | DATA INSCRIÇÃO | NAVEGADOR | PAÍS | REGIÃO | CIDADE | STATUS | ÚLTIMO ACESSO |
|---|
IMPRESSÕES TOTAIS
0
CLIQUES TOTAIS
0
CTR GLOBAL
0%
TAXA DE ENTREGA
0%
📍 Top Localizações
| PAÍS | REGIÃO | CIDADE | INSCRITOS |
|---|
📊 Desempenho por Notificação
| DATA | TÍTULO | IMPRESSÕES | CLIQUES | CTR |
|---|
Código de Integração
Siga as instruções abaixo para integrar as notificações push no seu site.
📋 INSTRUÇÕES DE INSTALAÇÃO
🔴 PASSO 1 - SERVICE WORKER (OBRIGATÓRIO)
Crie o arquivo sw.js na raiz do seu site e cole o código abaixo:
// sw.js - Coloque na raiz do seu site
const SERVER_URL = 'https://push.consultacobertura.com.br';
self.addEventListener('install', (e) => self.skipWaiting());
self.addEventListener('activate', (e) => e.waitUntil(clients.claim()));
self.addEventListener('push', (e) => {
let data = { title: 'Nova mensagem', body: 'Clique para abrir', url: 'https://goiasead.com.br' };
if (e.data) {
try { data = { ...data, ...e.data.json() }; }
catch (err) { data.body = e.data.text(); }
}
const options = {
body: data.body,
icon: `${SERVER_URL}/icon-192x192.png`,
badge: `${SERVER_URL}/badge-72x72.png`,
data: {
url: data.url,
subscriptionId: data.subscriptionId,
notificationId: data.notificationId
},
requireInteraction: true,
tag: data.notificationId ? `msg-${data.notificationId}` : `push-${Date.now()}`
};
e.waitUntil(self.registration.showNotification(data.title, options));
});
self.addEventListener('notificationclick', (e) => {
const notification = e.notification;
const data = notification.data || {};
const urlToOpen = data.url || 'https://goiasead.com.br';
notification.close();
e.waitUntil(
(async () => {
// Avisa o servidor sobre o clique (o servidor processará a geo via IP)
if (data.subscriptionId) {
fetch(`${SERVER_URL}/api/track/click`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
notificationId: data.notificationId,
subscriptionId: data.subscriptionId
}),
keepalive: true
}).catch(() => {});
}
const windowClients = await clients.matchAll({ type: 'window', includeUncontrolled: true });
for (let client of windowClients) {
if (client.url === urlToOpen && 'focus' in client) return client.focus();
}
if (clients.openWindow) return clients.openWindow(urlToOpen);
})()
);
});
🟢 PASSO 2 - CÓDIGO DE INTEGRAÇÃO
Copie o código abaixo e cole antes do fechamento da tag </body> do seu site:
<!-- Script de integração Push CRM -->
<script src="https://push.consultacobertura.com.br/webpush-client.js"></script>
<script>
if (typeof WebPushClient === 'undefined') return;
const pushClient = new WebPushClient({
serverUrl: 'https://push.consultacobertura.com.br',
swPath: '/sw.js'
});
try {
await pushClient.init();
await pushClient.subscribe();
} catch (error) {
console.error('Erro ao solicitar permissão:', error);
}
})();
</script>