Add a Coupon to the Clipboard After Signup

Lisa Fockens Updated by Lisa Fockens

Using Shopify? You can apply the discount code directly to the visitor's cart.

It is possible to add a coupon to the visitor's clipboard using our JS callbacks feature. In this example, we will automatically copy a coupon displayed on the "thank you" screen.

Step 1:

Create a signup block. In the "Button" section in the left-hand menu, select "Display a thank you message":

Step 2:

On your thank you screen, create a text block that contains the variable {{coupon}}. This variable will be automatically replaced by the actual coupon from a JS callback. It helps to have the coupon defined only in one place.

Step 3:

Create a new JS callback on the event Before popup display, with the following script:

window.wisepopsCoupon = 'WELCOME';
event.detail.wisepops('properties', {
coupon: window.wisepopsCoupon

Replace WELCOME  with your actual coupon code. This will be the unique place where your coupon is stored.

Step 4:

Create another JS callback on the event After form submit, with the following script:

var input = document.createElement('input');
input.value = window.wisepopsCoupon;;;
input.setSelectionRange(0, 99999);

Your coupon is now ready to be automatically added to the visitors' clipboards after signup.

Contact us if you have any questions.

How did we do?

Create a Spin-the-Wheel Popup Without Collecting the User’s Email Address

Create a Micro-Commitment Popup