WhatsInAName
WhatsInAName

Reputation: 41

How do I delay a SurveyMonkey pop-up?

We're hoping to get feedback on a new site launch (beta; site will fully launch March 28). To give end users the chance to explore the site, we'd like the pop-up to appear after 10 seconds. I'm extremely new to coding JavaScript on my own, so any help is greatly appreciated.

I found an answer to a very similar question (and indeed, some answers seemed more specific to my situation): delayed pop-up code; however, I can't get the code to work on my site.

The pop-up is embedded using this JavaScript, supplied by SurveyMonkey. There's no associated HTML or CSS.

(function(t,e,s,o){var n,c,l;t.SMCX=t.SMCX||[],e.getElementById(o)||(n=e.getElementsByTagName(s),c=n[n.length-1],l=e.createElement(s),l.type="text/javascript",l.async=!0,l.id=o,l.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd8fe_2Bhm5gFnGqBOI61Z1zZLxwDFd6OcUAaoSp03T3t6v.js"].join(""),c.parentNode.insertBefore(l,c))})(window,document,"script","smcx-sdk");

And this is the code I currently have, modified from one of the answers in the previous post.

function OpenSurvey(t,e,s,o){};
        window.setTimeout(function(){ OpenSurvey(window,document,"script","smcx-sdk"); }, 10000);

Upvotes: 4

Views: 1283

Answers (2)

BerZerKer
BerZerKer

Reputation: 1

I had this exact same issue and was beating my head into my desk trying to make this work by editing the code snippet from SurveyMonkey. I called SurveyMonkey and the most they could do was to send me an additional snippet with some new handlers - didn't work. Finally, I was about to call WIX and while making my way down the tree to find the best phone option for me, the site suggested I try reading the tutorial on embedding 3rd party code. BINGO!

Long story short, click this link and follow the instructions - ridiculously easy to implement and you don't have to paste the snippet into the page code - there is a specific section in the Advanced Setting of your site Dashboard (not the WIX account dashboard or the editor, if you ARE on the WIX dashboard click on your sites thumbnail and look for Settings in the dark blue right rail, then click Advanced Settings in the body of the page). Link to WIX instructions for 3rd party code below:

https://support.wix.com/en/article/embedding-custom-code-to-your-site#working-with-third-party-code

Good luck with your endeavores and I really hope this helps! The most challenging part of this was honestly getting the dashboards confused until I realized they meant to go to that particular site's settings.

BrZrKr

Upvotes: 0

Vairish
Vairish

Reputation: 31

I was running into the same issue today and I managed to get it working with this code. I hope this helps:

setTimeout(function(){ OpenSurvey(window,document,"script","smcx-sdk"); }, 60000);

function OpenSurvey(t,e,s,o){var n,a,c;t.SMCX=t.SMCX||[],e.getElementById(o)||(n=e.getElementsByTagName(s),a=n[n.length-1],c=e.createElement(s),c.type="text/javascript",c.async=!0,c.id=o,c.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/xxxxxxx.js"].join(""),a.parentNode.insertBefore(c,a))}

Upvotes: 3

Related Questions