Popup Visits Plugin: engage your visitors on their X visit! - createIT
Get a free advice now!

    Pick the topic
    Developer OutsourcingWeb developingApp developingDigital MarketingeCommerce systemseEntertainment systems

    Thank you for your message. It has been sent.

    Popup Visits Plugin: engage your visitors on their X visit!

    November 17, 2023
    Last update: April 4, 2024
    4 min read
    29
    0
    0
    Popup Visits Plugin: engage your visitors on their X visit!

    Part 2 of the series “Exploring WordPress popup solutions: a comprehensive guide”

    The digital landscape is flooded with content, and grabbing your user’s attention has never been more crucial. Introducing the Popup Visits Plugin – a solution that gives you the power to engage users when they’re most likely to be receptive: after a set number of visits.

    WordPress Modal plugins, like the Popup Visits Plugin, are versatile tools that introduce dynamic content layers to websites. These pop-ups can boost engagement by capturing user attention with timely content or offers, drive actions like sign-ups, downloads, or purchases. In essence, modal plugins offer a direct line to your audience, enabling richer interactions and improved website conversion rate.

    Unique features and benefits

    1. Tailored engagement: Choose when you’d like to display a popup – be it the user’s first visit or their tenth. You’re in full control.
    2. Built-in cookie management: The plugin uses advanced cookie techniques to track user visits, ensuring they’re engaged at the right moment.
    3. Customizable delay: Adjust the delay for your popup’s appearance to suit the pace of your content and the habits of your audience.
    4. Integrated with Magnific Popup: Leverages the popular Magnific Popup library for a seamless and stylish popup experience.
    5. Support for shortcodes & HTML: Craft your popups with the flexibility of shortcodes, HTML, or plain text.

    Admin panel settings

    1. Trigger on Page View # – Define when the popup displays based on user page visits. – E.g., Set to “3” to show the popup on the user’s third visit.

    2. Cookie lifetime (days) – Set the duration for the user visit tracking cookie. – E.g., “30” keeps the tracking active for 30 days.

    3. Popup show delay (seconds) – Decide the delay before the popup appears after page load. – E.g., “5” means a 5-second delay before the popup shows.

    4. Popup content – Input the content for the popup using shortcodes, HTML, or text.

    Wordpress dashboard with text and fillable forms

    Use cases

    • eCommerce: Use the plugin to offer special discounts or showcase new products to repeat visitors, increasing the chances of conversion.
    • Bloggers: Engage returning visitors with exclusive content, e-books, or newsletter sign-ups.
    • Online courses & webinars: Remind users about upcoming sessions or offer them a special discount for being a frequent visitor.

    Tips and best practices

    1. Optimize the timing: Too soon can be intrusive; too late might mean a missed opportunity. Test different visit counts to find the sweet spot for your audience.
    2. Keep it relevant: Ensure the content of your popup is relevant to the majority of your visitors. Tailored offers or content can significantly increase engagement rates.
    3. Monitor & adjust: Regularly check the performance of your popups. Adjust content, timing, and frequency based on user engagement metrics.

    Behind the scenes: JavaScript magic

    The heartbeat of the Popup Visits Plugin lies in its efficient JavaScript logic. Here’s a brief overview:

    1. Visit count: Upon every page load, the plugin increments the visitor’s page view count using cookies.
    2. Popup display logic: If the visit count matches or exceeds the predetermined trigger count and the popup hasn’t been shown yet, the plugin initiates a timer based on the set delay.
    3. Early navigation handling: If a user navigates away before the popup displays, the popup remains in the queue. This ensures that the visitor will still encounter the popup on their subsequent visit, making certain no engagement opportunity is missed.
    4. Popup execution: Once the delay timer concludes, the Magnific Popup library is summoned to display the crafted popup content.
    jQuery(document).ready(function($) {
        var JsonCookies = Cookies.withConverter({
            write: JSON.stringify,
            read: JSON.parse
        });
        var cookieData = JsonCookies.get('pvp_cookie_data') || { visitCount: 0, popupShown: false };
    
        cookieData.visitCount++;
        JsonCookies.set('pvp_cookie_data', cookieData, { expires: Number(pvp_data.cookie_lifetime) });
    
        if (cookieData.visitCount >= pvp_data.trigger_count && !cookieData.popupShown) {
            var popupDelay = pvp_data.delay * 1000;
    
            setTimeout(function() {
                ctOpenPopup();
                // Update the popupShown flag after displaying the popup
                cookieData.popupShown = true;
                JsonCookies.set('pvp_cookie_data', cookieData, { expires: Number(pvp_data.cookie_lifetime) });
            }, popupDelay);
        }
    
        function ctOpenPopup() {
            $.magnificPopup.open({
                items: {
                    src: '#pvp-popup',
                    type: 'inline'
                },
                closeBtnInside: true,
            });
        }
    });
    

    Data storage and format

    One of the standout features of the Popup Visits Plugin is its efficient data storage mechanism. Leveraging JavaScript’s Cookies library, user data is stored in a structured JSON format. This includes the visit count and a flag indicating whether the popup has been displayed to the user.

    For instance, the data might look something like this:

    {
        "visitCount": 3,
        "popupShown": false
    }
    

    Examples

    1. Donation call-to-action

    Ask for donations using a donation plugin shortcode. GiveWP plugin modal implementation:

    <h1>Help good cause</h1>
    [give_form id="694"]
    
    A window with an image, a button and text

    2. Discount offer

    Promote discounts or special offers.

    <h1>Get discount for your next order</h1>
    <p>Click the banner</p>
    <img src="/wp-content/uploads/2023/black-friday-2946943_1280.jpg">
    
    An advert with text and an image of a woman with sale signs floating above her head

    Source code on GitHub

    The Popup Visits Plugin is a testament to the idea that simplicity and versatility can coexist harmoniously. With its user-friendly design, expansive application possibilities, it’s a tool that can enhance any WordPress site’s engagement strategy.

    Access the full source code of the Popup Visits Plugin on our GitHub repository: https://github.com/createit-dev/313-Popup-Visits-Plugin-Engage-on-X-Visit

    The Popup Visits Plugin is licensed under the MIT License. This means it’s free for both personal and commercial use, and you can modify or distribute the code as you see fit.

    Introduction: “Exploring WordPress popup solutions: a comprehensive guide”

    For WordPress sites, popups have become a pivotal element in this optimization stack. With a plethora of plugins and configurations available, making an informed choice demands a deeper understanding. That’s where our series comes in.

    1. “The power of popups: why every WordPress site needs one” – Dive into the world of popups, exploring their diverse types, multifaceted benefits, and deployment best practices. This comprehensive guide also demystifies common misconceptions and provides illustrative scenarios to showcase their potential impact.
    2. “Introducing the ‘Popup Visits Plugin’: engage your visitors on their X visit!” – Dive deep into the ‘Popup Visits Plugin’, exploring its unique features, real-world applications, and optimization tips.
    3. “Exploring alternatives: leading WordPress popup plugins in 2023” – Survey the broader landscape of WP popup plugins in 2023, delving into the strengths and limitations of each offering.

    Technology
    Be on the same page as the rest of the industry.

    Contact us