1. Home
  2. Docs
  3. PongSetup options

PongSetup options

Set window.PongSetup before the loader runs. Options set here win over the workspace defaults chosen in the desk; data-* attributes on the loader tag win over both.

<script>
  PongSetup = {
    language: 'en',
    theme: 'auto',
    buttonStyle: 'round',
    buttonPosition: 'bl',
    colors: { buttonBg: '#2f6fed', buttonText: '#fff' },
  };
</script>
<script src="https://js.pong.ee/YOUR_PUBLIC_KEY" async></script>

As attributes

Most options can also go on the loader tag itself, with no extra script — handy in site builders and GTM:

AttributeValuesSame as
data-idyour public key, only with the older call.pong.ee/pong.js addressPongID
data-languageen, rulanguage
data-themelight | dark | autotheme
data-color#hexcolors.buttonBg
data-button-style3d | round | tabbuttonStyle
data-button-positionbr | blbuttonPosition
data-button-texttextbuttonText
data-sizesmall | normal | largesize
data-title, data-subtitletexttitle, subtitle
data-chat-width, data-chat-heightpixelschatWidth, chatHeight
data-z-indexnumberzIndex
data-start-hiddentrue | falsestartHidden
data-group-idgroup idgroupId
data-client-idyour user idclientId
data-deferred-loadingtrue | falsedeferredLoading
data-inject-toelement idinjectTo
data-commandstrue | falsecommands
data-data-layerlayer name, or false for nonedataLayer
data-debugtrue | falsedebug
data-onloada function name, e.g. onPong or app.onPong— (see below)

To run your own setup code once the widget is ready, name a function in data-onload; it receives the Pong API — see Run your code when Pong is ready.

Look

OptionTypeWhat it does
theme'light' | 'dark' | 'auto'Widget theme; auto follows the visitor’s system. Default light.
colorsobjectbuttonBg, buttonText (accent colour), clientBubbleBg, clientBubbleText, agentBubbleBg.
buttonStyle'round' | 'tab' | '3d'Launcher look. Default: the workspace setting.
buttonTextstringText on the launcher.
title, subtitlestringHeader of the chat window.
language'en' | 'ru'Widget interface language. Default: the page’s <html lang>, then English.

Placement

OptionTypeWhat it does
buttonPosition'br' | 'bl'Bottom-right or bottom-left corner.
startHiddenbooleanKeep the button hidden until you call show or an agent writes.
size'small' | 'normal' | 'large'Widget size: the open chat on desktop (320×460, 350×510 or 380×560 px) and the launcher (a 48, 56 or 64 px ball; the tab scales the same way). Default: the workspace setting (Settings → Chat widget), large if none. On phones the chat is full screen.
chatWidth, chatHeightnumber (px)Exact size of the open chat on desktop; wins over size. On phones the chat is full screen.
zIndexnumberStacking order, if your page has overlays above the chat.
injectToelement idMount the widget inside this element instead of <body>.

Behaviour

OptionTypeWhat it does
deferredLoadingbooleanWait for the load event and an idle moment before mounting.
groupIdstringInitial group (also window.PongGroupID).
identityobjectSigned identity { userhash, ts, sig } — see Verified identity.
clientIdstringYour own user id, sent as a hint to label the visitor.
commandsbooleanSet false to stop agents from reloading the page or opening another page of your site for the visitor.
dataLayerstring | falseWhere chat events are pushed for Google Tag Manager: another layer's name, or false for none. Overrides Settings → Chat widget → Analytics (dataLayer by default).
onAnalyticEventfunctionCalled with Chat opened, Chat closed, Message sent, Chat initiated by agent.
debugbooleanLog unsupported calls and Pong.debug output to the browser console.

Hide parts of the page from screenshots

Agents can request a snapshot of what the visitor sees. Password, card and one-time-code fields and the chat itself are always hidden. Mark anything else private with an attribute:

<div data-pong-private>Account balance: €1,240</div>

← EventsVerified identity →