How to add Global Variable in an Embed (JS Code) because we don't use an Url. Thanks

How to add Global Variable in an Embed (JS Code) because we don't use an Url. Thanks

Hi there,

You can have a look at this article to understand the entire process of adding Global Variable in an Embed (JS Code):

Feel free to reach out if you have any further questions or queries. We will be more than happy to help.

Have a great day ahead :slight_smile:


I’m interested in this use case, but unfortunately the link is not working anymore. Where can I access this information?


Hey there!

You can access the information here.

Please check and let me know if this works! :slight_smile:

Thanks in advance!

Hey, I am also interested in this, since I have an exact use case, but above link is not working... So I would appreciate it if someone could share a way to embed global variable in with embed share.

I found an article that explains how to use custom variables but with popup, and our case is inline embed...

HI @nemanjanasradin ,

Welcome to the community

Please find the sample code below.

<div id="ss_survey_widget"></div><script>(function(){var e="ss-widget",t="script",a=document,r=window;var s,n,c;r.SS_WIDGET_TOKEN="tt-bc151f2928";r.SS_ACCOUNT="";r.SS_SURVEY_NAME="test-unique";if(!a.getElementById(e)){var S=function(){S.update(arguments)};S.args=[];S.update=function(e){S.args.push(e)};r.SparrowLauncher=S;s=a.getElementsByTagName(t);c=s[s.length-1];n=a.createElement(t);n.type="text/javascript";n.async=!0;;n.src=["https://","",r.SS_WIDGET_TOKEN].join("");c.parentNode.insertBefore(n,c)}})();

window.sparrowConfig = {

    triggerOnLoad: false


window.SparrowLauncher('popup', {

  variables: {

    name: "John Doe", 

    useremail: ""



// this will hide the widget when the survey is completed, you can remove this function if not required

 window.addEventListener('message', (e) => {

 if(e && && === 'surveyCompleted') {

const { response, customParams } =; 



}); </script>

I hope this helps; feel free to reach out for further assistance.


1 Like