Google analytics cross domain settings utilities
<script src="/path/to/gaxd.js"></script>
or
<script src="/path/to/gaxd.source.js"></script>
Load universal analytics and setup ga("create", ...) then:
// for redirect
gaxd.source.redirect({
origins: ["https://destination.com"]
})
// for iframe
gaxd.source.iframe({
selector: "#iframe-form",
destinationOrigin: "https://destination.com"
});
<script src="/path/to/gaxd.js"></script>
or
<script src="/path/to/gaxd.destination.js"></script>
Load universal analytics then:
gaxd.destination({
trackingId: "UA-XXXXXX-X",
sourceOrigin: "https://source.com"
}).then(ga => {
ga("send", "pageview");
});