How to Implement Per-Page Widget Configurations on a Single Domain
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, wordpress
Direzione di ricerca
Inizia con l’integrazione del widget Chatwoot del plugin WordPress e con l’entry point chatwoot:ready descritto nell’issue. Verifica come ciascuna pagina elencata seleziona il proprio website_token e la propria locale, come vengono letti i cookie e come setUser() riceve i dati di identità dell’utente. Il lavoro è completato quando i tre URL caricano la casella di posta e la lingua previste senza un modulo pre-chat.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello team, How Much $$?
I would like to get some guidance on the best way to implement the Chatwoot web widget in a multi-language WordPress environment.
My Use Case:
I have a single WordPress website that serves content in three different languages on separate pages:
https://mysite.com/pagina-portugues (Portuguese)
https://mysite.com/pagina-espanhol (Spanish)
https://mysite.com/pagina-english (English)
My Goal:
I want to display a unique and independent chat widget on each of these pages. Each widget instance needs its own specific configuration.
Requirements:
Individual Inboxes: Each page's widget should connect to a different inbox. This means I need to initialize the script with a unique website_token for each page.
Language-Specific Interface: The widget's language (locale) must match the page's language (e.g., pt_BR for Portuguese, es for Spanish, en for English).
Secure Identity Verification: I plan to use HMAC for secure identification, so the identifier_hash will be generated and passed to the widget for each logged-in user.
Pre-fill User Data from Cookies (No Pre-Chat Form):
The pre-chat form must be disabled.
My website already saves the user's information (name, email, phone) in browser cookies after they fill out an initial contact form.
I need the Chatwoot widget to automatically identify the user by reading these values from my site's cookies and setting them using the window.chatwootSDK.setUser() method.
My Question:
What is the best practice for loading the widget script with these different configurations on a page-by-page basis? My primary challenge is figuring out how to dynamically pass the correct website_token, locale, and user information from cookies to the Chatwoot SDK on each specific page load.
Could you provide an example of how the JavaScript snippet should be structured to achieve this? Specifically, how to:
Load the base script.
On the chatwoot:ready event, read browser cookies.
Set the user's identity with setUser().
Set the correct locale for that page.
Thank you for your help!
- Lingua principale
- PHP
- Stelle
- 39
- Fork
- 19
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di chatwoot/wp-plugin
Tutte le issue di chatwoot/wp-plugin
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
PHP SDK drops the API path prefix when a custom base URL has no trailing slashForse già presa @Winoren l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
langgenius/dify#44568 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno