How to use a custom call action to trigger your Zigpoll campaign.

Take your Zigpoll integration to new heights by adding some simple javascript code to your project. Follow the steps below to learn how you can trigger a Zigpoll based on some event. We will be using a button click in order to trigger the Zigpoll, but you could hook this code into any event you like.

Step 1: Hook into your button click event.


$('#zigpoll-button').on('click', function () {
  console.log('button clicked');
  // We will put our Zigpoll code here.
});

Step 2: Render your poll with javascript.


function renderZigpoll() {
  var pollId = YOUR_POLL_ID;
  window.Zigpoll.pollId = pollId;
  window.Zigpoll.onload = function () {
    window.Zigpoll.open();
  }
  window.Zigpoll.refresh();
}

Step 3: Call the action when your event occurs.


function renderZigpoll() {
  var pollId = YOUR_POLL_ID;
  window.Zigpoll.pollId = pollId;
  window.Zigpoll.onload = function () {
    window.Zigpoll.open();
  }
  window.Zigpoll.refresh();
}

$('#zigpoll-button').on('click', function () {
  renderZigpoll()
});

That's it! All you need to do is replace YOUR_POLL_ID with the poll id for your poll. You can get the poll ID by going to Polls → Select Your Poll → Click the Manage tab and copy the Poll Id.

So let's do this.

Try our no-code surveys that customers actually answer.

Questions or Feedback?

We are always ready to hear from you.