peaksandpies / universal-analytics

A node module for Google's Universal Analytics and Measurement Protocol
961 stars 146 forks source link

GA + UA #164

Open PuhlyaMan opened 3 years ago

PuhlyaMan commented 3 years ago

Hello. I have two id (GA - G-XXXXX, UA - UA-XXXXX). How can I use them both, or is it impossible?

Example gtag.js:

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXX');
  gtag('config', 'G-XXXXX');
</script>
Vindexus commented 3 years ago

Did you ever find an answer to this?

mxswat commented 3 years ago

As far as I'm aware you must use the UA. But correct me if I'm wrong