Zigpoll
  • What is Zigpoll
  • Accounts
    • General Settings
    • Display Settings
    • Visibility Settings
    • Targeting Settings
    • Language Settings
    • Embed Code
    • Monthly Requests
    • Surveys
    • Join Existing Account
  • Surveys
    • General Settings
    • Display Settings
    • Visibility Settings
    • Targeting Settings
    • Language Settings
    • Management Options
    • Slides
    • Survey Preview
    • Import
  • Slides
    • Types of Slides
    • Slide Logic
    • Template Variables
  • Embed
    • Participant Metadata
    • Survey Metadata
    • Template Variables
  • Participants
  • Subscription Plans
    • How we calculate responses
  • Billing
  • Notifications
  • Javascript API
  • Shopify App
    • Log In
    • Shopify Flow
  • Affiliate Program
  • Wordpress
  • Public Link
  • Integrations
    • Klaviyo
    • Mailchimp
    • GetResponse
    • Omnisend
    • Gorgias
    • ActiveCampaign
    • Google Analytics
      • Slack
    • Shopify
    • Google Sheets
  • Tutorials
    • Adding Team Members
Powered by GitBook
On this page

Javascript API

Want to create come custom behavior for your Zigpoll?

Single Page Web Apps

If you have a single page website you can still use Zigpoll. All you need to do is run the following code immediately after you change a page within your app.

window.Zigpoll.refresh();

Programmatically Toggle The Poll

If you want to toggle your Zigpoll programatically (like when a user clicks a button) use the following function.

window.Zigpoll.toggle();

This will toggle your Zigpoll open and closed.

Alternatively you can use:

window.Zigpoll.open();
window.Zigpoll.close();

To open and close the Zigpoll respectively.

Trigger Event Once Zigpoll Is Loaded

To trigger some behavior once the Zigpoll has loaded, use the onload parameter of the Zigpoll object. For example:

window.Zigpoll.onload = function () { console.log('Zigpoll loaded') }

This will run once immediately after the Zigpoll has been loaded on your page.

PreviousNotificationsNextShopify App

Last updated 5 years ago