You've installed the InGo Activator (formerly Login widget), and everything is working great until you realize that when a user logs in with one of the social network buttons on the InGo widget, your analytics platform loses sight of what happens. You might be tempted to turn one the "Forward Query String" option. But if you did you would quickly realize that this only solves the problem when someone gets to the page where the Activator (Login) widget is through a series of pages, but when they go directly to that page (for example from an email link or a link on another site or an ad), the widget drops (or more correctly doesn't know about and doesn't pass on) your analytic tokens. In this article, we'll describe one solution to this type of problem using a Google Analytics example.
Script Your Next URL
Your Activator widget is loaded by an HTML script element which specifies the widget to load and any additional parameters to configure it. It's a simple drop in element. As of version 1.4.0, the Activator widget can execute whatever javascript code you want to execute before passing control to the social network for authorization. Because it's script, you can do any extra work you might need to do in the script to setup your widget. This might include dynamically creating your next URL it total or figuring out which parameters to send along to the next page, or most pertinent to this article, to pass along analytics tags. Here's a sample of what that looks like:
<div id="widget"></div>
<!-- Activator widget passing along Google Analytics tags -->
<script src="https://cdn.ingo.me/widgets-loader/1.4.4/js/ingo.loader.widget.js"
data-ingo-id="INSERT_YOUR_ACTIAVTOR_ID_HERE"
data-ingo-manual="return 'https://www.example.com/reg.htm?_ga=' + _ga.getByName('bu').get('clientId');"
data-ingo-target="#widget"
data-ingo-is-manual-script="true">
</script>
Here we are changing the "manual" setting from a static URL to dynamic script content. Also we are setting the "data-ingo-is-manual-script" parameter to true, letting the Activator widget know that it should treat the manual value as script and execute it.
NOTE: the specifics of the GA call might change so please make sure to look at the docs for the specific call you need to make in your situation and with the version of GA or other analytic tool your using
Return URL
One thing to make sure of here is that your script ends by returning a valid URL to the InGo widget. This is important. If your script does not return a valid URL, the InGo widget will not make the necessary call to the social network or execute the expected redirection. The InGo widget doesn't care what you do within the script call (of course, Javascript rules, HTML/HTTP rules etc apply). You could script numerous calls to one or another endpoints, check for X, check for Y, draw circles on the page, flash pictures of cats. your call. Doesn't matter to us, as long as you return us a valid URL for where to send your registrant after social authorization.
I hope this has been helpful and enables you to track your users with InGo better.