Google Analytics
This code is used to track users in GA across two completely different root domains (A.com to B.com). Insert the code below into your Unbounce landing page.
<script>
$('.lp-pom-button, .lp-pom-text a, .lp-pom-image a').click(function(event) {
var parentClass = $(this).parent().attr('class');
var isFormRedirect =
parentClass === 'lp-element lp-pom-form' &&
window.module.lp.form.data.confirmAction === 'url' &&
lp.jQuery('form').valid() === true;
if (isFormRedirect) {
ga(function(tracker) {
var linker = new window.gaplugins.Linker(tracker);
window.module.lp.form.data.confirmData = linker.decorate(window.module.lp.form.data.confirmData);
});
} else {
ga('linker:decorate', this);
}
});
</script>
Google Tag Manager
Follow the article below. See section "Clicks from A.com to B.com (Auto Event Tracking)" https://support.google.com/tagmanager/answer/3561401?hl=en#StepsClicksAutoEventTracking