Some customers prefer to see the full referral URLs in the “pages visited” field (not just the path).
For that reason, we created a slightly updated version of GA Connector tracking code that does just that:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<script data-cfasync="false" type="text/javascript" src="https://tracker.gaconnector.com/gaconnector.js"></script> <script> function addFullPathToPagesVisited(gaFields) { var prefix = window.location.protocol + "://" + window.location.host; var pagesVisitedList = gaFields['pages_visited_list']; pagesVisitedList = pagesVisitedList.replace(/\|/g, "|"+prefix); pagesVisitedList = prefix + pagesVisitedList; gaFields['pages_visited_list'] = pagesVisitedList; return gaFields; } function setGaconnectorHiddenFields() { var gaFields = gaconnector.getCookieValues(); gaFields = addFullPathToPagesVisited(gaFields); for (var fieldName in gaFields) { var selectors = 'form input[name="' + fieldName + '"], form input#' + fieldName + ', form input#field_' + fieldName + ', form input[name="' + fieldName.toLowerCase() + '"], form input#' + fieldName.toLowerCase() + ', form input#field_' + fieldName.toLowerCase(); var inputs = document.querySelector(selectors); if (inputs === null) { continue; } else if (typeof inputs.length === 'undefined') { inputs.value = gaFields[fieldName]; } else { for (var i = 0; i < inputs.length; i++) { inputs[i].value = gaFields[fieldName]; } } } } gaconnector.setCallback(setGaconnectorHiddenFields); setInterval(setGaconnectorHiddenFields, 1000); </script> |