# On-Click Button Targeting

On-Click Targeting - How It Works? (Popupsmart Popup Builder)

Did you know that you can embed a button on a page that opens your popup with a click? Popupsmart’s on-click button feature makes it as easy as a snap of your finger. Basically, it improves the user experience by not bombarding users with a popup immediately after landing on a page. The popup works on the condition of clicking the set button.

The on-click button feature works anywhere on your website that supports JavaScript and HTML. All you need to do is customize your button, copy and paste the generated code snippet to where you want to show it.

Pro Tip:Leave this process to last when you’re customizing your popup. Once your main popup is done, you can align your button based on it. Additionally, think of this on-click button as an embed button. It’s possible to embed it anywhere on a JS-supported page such as in a blog post.

There are two different ways to create an On-Click Popup Button.

# Method 1 for Creating On-Click Button

Step 1:Go to the Target section (third Step) on your popup editor. Then, click On-Click Popup Button Creator.


Step 2:Enter a button text, adjust the font size, and make additional customization. Once you’re done, click on the Get the Code button.


Step 3: You’ll see a code snippet on the bottom right of the modal after you click on the Get the Codebutton. Then, click on Copy Embed Code.


Step 4: You can now paste your unique code snippet anywhere on your website that supports JavaScript HTML. For example, you can paste it into a blog post in between paragraphs to let readers click to show the popup and see your offer.

# Method 2 for On-click Targeting

Navigate to the Targeting tab and click Visitor Behavior. Then, scroll down and select On Click. This option is more technical compared to the former option.


You may tweak the given JavaScript code to change your button style, however, by default, your popup button code will as <button onClick="javascript:showPopupSmart27698();" type="button">Click</button>

Here’s an example of how the button will look with the default of this option:

<button name="button" onclick="javascript:showPopupSmart3005();">Click here to show up popup!</button>

If you’d like a simpler and ready-made design, we recommend using the first method.

Still have questions? Feel free to contact us via live chat or email!