1. InGo Help Center
  2. Creating Promotional Materials

Advanced: Adding Language Parameters to the Widgets via Query String Arguments

Advanced Example, Italian

If you have two events in InGo's Admin as 1 English and 1 Italian for example, and if your site uses the same URL in the page with the exception of a language parameter (lang=it for example), then you will need to activate those specific widgets.

In the InGo Dashboard / Admin 

  • Be sure to activate the "query string" on the Activator Widget via the checkbox
  • Integrate the following example script to ensure you can return the necessary language and then display the appropriate widget, based on the language.
<script src="//cdn.ingo.me/widgets-loader/1.0.1/js/ingo.loader.widget.js"></script>
<script>
$(function() {
function getArgs(qs) {
var results = {};
(qs || "").replace(/[?&]([^=]+)=([^?&]+)/g, function(_, key, value) { results[key] = value; });
return results;
}
var qsArgs = getArgs(document.location.search);
var lang = qsArgs.lang || "en";
$('SOCIAL-WIDGET-SELECTOR').loaderWidget({
"widgetId": lang === "en" ? "ENGLISH_AMPLIFIER_WIDGET_ID" : "ITALIAN_AMPLIFIER_WIDGET_ID",
"lang": lang
});
});
</script>