Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1285024

    Hello,
    I should add a button with a call to a javascript function in order to open the zoho survey popup.
    I tried with this code:
    <a href="#survey" onclick="zsShowPopup()" target="_blank" rel="noopener noreferrer"> take it now </a>
    and the script I placed it in the function.php file as suggested in the documentation with this code:

    function popup_pod(){
    ?>
    <script>
    
    (function(w,d,s,u,f,m,n,o){o='https://survey.zohopublic.com';w[f]=w[f]||function(){(w[f].p=w[f].p||[]).push(arguments);};m=d.createElement(s),n=d.getElementsByTagName(s)[0];m.async=1;m.src=o+u;n.parentNode.insertBefore(m,n);zs_intercept(o,'EJRKl6',{"displayPeriod":4,"chosenPages":["https://leagrowingpeople.com/positive-intelligence/"],"position":2});})(window, document, 'script', '/api/v1/public/livesurveys/EJRKl6/popup/script', 'zs_intercept');function zsShowPopup(){var i=setInterval(function(){if(window.zsShowFrame!==undefined){window.zsShowFrame();clearInterval(i);}},300);}
    	
    </script>
    <?php
    }
    add_action('wp_head', 'popup_pod');

    But it did not work.
    Here: https://help.zoho.com/portal/en/kb/survey/launch/website-insert/articles/website-insert#To_create_a_pop-up_survey Zoho Popup Survey Documentation.
    What do you suggest?
    Thank you for your help,
    Manuela

    #1285212

    Hi Manuela,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    1. Install and activate ” Temporary Login Without Password “.
    2. Go to ” Users > Temporary Logins ” on the left-side menu.
    3. Click ” Create New “.
    4. Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
      ( to be sure that we have enough time to debug ).
    5. Click ” Submit “.
    6. You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.

    When your issue is fixed, you can always remove the plugin!
    If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.

    Best regards,
    Nikko

    #1285256

    Hi,
    I prefer not use the plugin.
    Thank you for your help,
    Manuela

    • This reply was modified 3 years, 9 months ago by famarinu.
    #1285717

    Hi Manuela,

    I have made a test page that’s privately published (link in private content).
    Also at the end of the script (function that runs when the link is clicked), I added:

    console.log('clicked');

    which should just display clicked on the web console when the link is clicked (you can test this by right-clicking on any part of your site, click Inspect then Console), since console.log worked properly then the code provided itself is not working.

    I also tested the js code with an empty HTML file and it does not work as well.
    Another test you can do is to use a default WordPress theme (like twentytwenty) since wp_head is a WordPress hook and not enfold exclusive.

    Best regards,
    Nikko

    #1288515

    Hi,
    I noticed that when I save the function call: “onclick = “zsShowPopup ()” is delete, Why?
    I added but the system remove.
    https://monosnap.com/file/VdgEP26qwpDStm89QLZiC9q8aFLI7b
    https://monosnap.com/file/3I96eyhKjXdRT9GOgY18IdflFbQvdf
    Thank you for your help,
    Manuela

    • This reply was modified 3 years, 9 months ago by famarinu. Reason: add image
    #1288746

    Hi Manuela,

    I don’t think it’s good to put it inside a Text Block, try to use a Code Block instead.
    If that still does not work, please use a Widget element.

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.