Return

Customising the Widget
Widget I install,
configure with joy now I,
with widget at one.



How the widget code usually works

The default WTF widget first downloads the widget JS file

<script src=/"https://whatthefaq.herokuapp.com/js/widget.js"></script>

We then make two calls. The first initialises the library, while the check() checks the WTF servers for content on the current page and downloads displays the icon.

WTF_Lib.init(["5827bd6fa23d0c1b39def88d"]);
WTF_Lib.check();

Customisation: Prefilling email

If a user chooses to leave a message WTF by default asks for their email. If youd like to make thier journey a little smoother and know the users email, allow WTF to prefill the email address using this method:

WTF_Lib.init(["5827bd6fa23d0c1b39def88d"]);
WTF_Lib.setDefaults({'email':'users_email'});
WTF_Lib.check();

Just replace "users_email" with the current users email via your templating engine.


Other Resources

If you want to get your hands really dirty, take a look at the WTF API. You can use this to roll custom integrations of WTF on platforms not yet supported out of the box, such as IOS, Android etc.


©2016 - WTF Inc.