Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
window.sendGreenbackMessage({trigger: 'default'}) // It will open the chat modal
window.sendGreenbackMessage({message: 'Show me green dresses', trigger: 'pdp'})
window.sendGreenbackMessage({message: 'Show me green dresses', trigger: 'default'})
window.sendGreenbackMessage({message: 'Show me green dresses', trigger: 'pdp', source: 'size button'})

...

Name

Required

Data Type

Example

Explain

message

YesNo

string

Show me some blue dresses

The message field is a text that will be sent to the AI.

trigger

Yes

pdp | default

default

Trigger indicates where we are passing the data. There are two options “pdp” and “default”.

  1. pdp: data passing to pdp and message will show up in pdp.

  2. default: data passing to chatbot

    1. Show the message in the chatbot.

    2. open the chatbot if it is not already opened.

source

No

string

Size Button

The source field is an optional field to indicate what has triggered this action.

E.g. source: “size button” meaning the size button triggered this action

Info

Note: when trigger is default and message is empty, it will open the chat modal if it is not already open

Implementation

The Greenback widget exposes an API to allow customers to use it on the page. To use the API, customers need to pass in the correct data structure with the required fields.

...