As of v2.4.x of the Activator widget, InGo has introduced the ability to let you as the organizer more easily script where the Activator widget directs users. We have had numerous customer requests to make the Activator widget dynamically determine where the Activator widget should go next after social or manual authorization and up till now this has always required some manual script munging on your site that was not ideal nor pretty.
Now you can script it yourself!
With the release of version 2.4.x of the Activator widget, you can now enter script into your Activator widget's manual
parameter. It might look something like this:
Alternatively you may want to include this same script in your widget parameters with the inline script attribute data-ingo-manual like this:
<script src="https://cdn.ingo.me/widgets-loader/1.4.4/js/ingo.loader.widget.js" data-ingo-id="PW3RFVUG0DBEQVUDHMXMHII02DJAKYQE" data-ingo-manual="return 'https://myexample.com/registration-page-' + selection;"></script>
In this case, you would be directing the user to your next registration page dynamically where the page suffix is the social network they've selected.
Requirements
The most important thing to remember is that your script MUST RETURN A VALID URL. The URL can be generated using any valid javascript that is withing this tag or within a method on the page (as for example depicted by the "getIsReturningUser()" call in the script above). We don't care what you do to build the returned URL, that's up to you. As long as you return a valid URL we'll send your user there next.
Paramters
There is only one parameter currently provided to the script that you can utilize. This parameter is called "selection" and represents the type of activation your user selected.
Parameter | Desciption |
selection | either 'manual' if the user chose to activate with the manual option, or the name of the social network chosen, e.g., 'facebook', 'linkedin', 'twitter' etc. |
Restrictions
The only real restrictions are those of the javascript language and browser restrictions and compatibility issues. Be sure to test your script's functionality in multiple browsers to ensure that it works as expected. A tool like BrowserStack can come in very handy for this.
Obviously we expect good behavior. Don't do anything malicious. You're running script on your customer's browsers. You are responsible to make sure your script is not malicious or dangerous. We do not use eval when running your script. Don't run third party scripts unless you really know what they're doing. Also, if you need to include third party scripts in your page, do so within the page, not here. This script is triggered when the user clicks one of the activation mechanisms on the widget, so you want it to be as responsive as possible.
Happy Scripting!
Comments
0 comments
Please sign in to leave a comment.