Cross Domain Tracking

How do I setup cross domain tracking with SkyGlue?

SkyGlue automatically takes advantage of the GA cross-domain tracking if you have already set it up for your website. No additional cross-domain tracking setup is needed for SkyGlue to track visitors across domains.

If you have not set up cross-domain tracking for your website, please follow this documentation to implement GA cross-domain tracking. If cross-domain links are all href links, you can add the following code to automate cross domain tracking in Google Analytics. The code is adapted from https://github.com/lunametrics/xdomain/blob/master/xdomain.js. Original post is here.

                 var domains=["domain1.com","domain2.com"];
                 var valid = false;
                 jQuery.each(domains, function(j) {
                                 if((jQuery(link).attr('href').indexOf(this)!=-1)&&(window.location.href.indexOf(this)==-1)){
                                         valid = true;

                                         if (valid)
                                         {
                                                 jQuery(link).bind('click', function(l) {
                                                         if(typeof(_gat)=="object"){
                                                                 l.preventDefault();
                                                                 if (jQuery(link).attr('target') != "_blank")
                                                                 {
                                                                         _gaq.push(['_link',jQuery(link).attr('href')]);
                                                                 }
                                                                 else
                                                                 {
                                                                         var tracker = _gat._getTrackerByName();
                                                                         var fullUrl = tracker._getLinkerUrl(jQuery(link).attr('href'));
                                                                         window.open(fullUrl);
                                                                 }
                                                         }
                                                 });
                                         }
                                 }
                 });