All Collections
Customizations
How can I initiate the Tolstoy widget via a button click?
How can I initiate the Tolstoy widget via a button click?
Marie Medina avatar
Written by Marie Medina
Updated over a week ago

Opening a Tolstoy widget with a click of a button on your website can be super helpful if you prefer not to overpopulate your page. If you are wondering how you can make a Tolstoy widget appear on the same page by just clicking a button, no problem! We got you. We have a way to do that, and here's an easy tutorial to follow:

1. You can initiate a Tolstoy widget by adding a script to the button you want to click:

window.tolstoyWidget.recreate('<TOLSTOY_PUBLISH_ID>');


โ€‹

2. To get the publish ID, go to Settings (the icon next to the Analytics button on the upper right) -> Tolstoy ID.

Click on highlight
Click on highlight


โ€‹

3. This will be your sample script.

window.tolstoyWidget.recreate('<2a3c6hwvt9ngo>');


You are all set! You can paste the code to any button on your website where you prefer Tolstoy to appear.

Have any questions? Feel free to send us a note at support@gotolstoy.com.

Did this answer your question?