Skip to content
/ gaxd Public

Google analytics cross domain settings utility

License

Notifications You must be signed in to change notification settings

wacul/gaxd

Repository files navigation

gaxd

Google analytics cross domain settings utilities

source

initialization

<script src="/path/to/gaxd.js"></script>
or
<script src="/path/to/gaxd.source.js"></script>

setup

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"
});

destination

initialization

<script src="/path/to/gaxd.js"></script>
or
<script src="/path/to/gaxd.destination.js"></script>

setup

Load universal analytics then:

gaxd.destination({
  trackingId: "UA-XXXXXX-X",
  sourceOrigin: "https://source.com"
}).then(ga => {
  ga("send", "pageview");
});

About

Google analytics cross domain settings utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published