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 in the Thank you screen.

Step 1:

Create a sign-up block. In the "Button" section on the left, 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 us having 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  by 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;
event.target.parentNode.appendChild(input);
input.select();
input.setSelectionRange(0, 99999);
document.execCommand("copy");
input.parentNode.removeChild(input);

Your coupon is now ready to be automatically added to the visitors' clipboards after sign-up.

Don't hesitate to contact us if you have any questions.

Did this answer your question?