In this article I'll show you how to add a Popup to a contest, so that the Popup is triggered (meaning its displayed on the screen) after a person votes on an entry in the contest.

This works for any Wishpond contest app that allows visitors to vote on entries, including Vote Contest, Photo Contest, Hashtag Contest, Video Contest and all others. 

Here are the steps I'll show you to trigger a Popup after a visitor votes: 

  1. Create a Popup that's triggered using Javascript
  2. Insert the Popup's ID into a piece of Javascript (provided below)
  3. Add the Javascript to your contest


1. Create a Popup that's triggered using Javascript

Follow these steps to do this:

  1. In the Campaigns dashboard, click on Popup to create one (you may need to click on "View More" to find the Popup campaign, depending on your chosen Industry)
  2. Choose a template and builder your Popup using our drag-and-drop editor
  3. In the top-right corner of the Popup editor, click "Next"
  4. On the next page, click on "More Display Options"
  5. Click on the "Show when visitors" dropdown and choose "trigger javascript"
  6. Copy the number that appears in the "Javscript to open popup" field - this is the Popup's ID and will be used in the next step
  7. Publish the Popup


2. Insert the Popup's ID into a piece of Javascript (provided below)

Follow these steps to do this:

  1. Get the Popup ID from the Display Options page of the Popup editor (this is the number that appears in the "Javscript to open popup" field)
  2. Replace the [Enter Popup ID] text in the Javascript code snippet below with the Popup ID:

var inter = setInterval(function(){
  if ($('.voted')[0]){
    console.log("voted");
    Wishpond.Popup.show([Enter Popup ID]);
    clearInterval(inter);
  }
  else{
    console.log("not Voted");
  }
},1000)

  3. Copy the Javascript code snippet (with your Popup ID in it)


3. Add the Javascript to your contest

Follow these steps to do this:

  1. In the the top-right corner of the contest editor, click on "Edit CSS and JS"
  2. Paste in the Javascript code (provided above)
  3. Click "Save"
  4. Save & Publish your contest to see it live!

Note: You will need to be on a Plan that include Custom Javascript for this to work

Did this answer your question?