Can i set google analytics user id multiple time?

Viewed 60
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $account_id }}"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'XXXXX');
</script>

here gtag('config', 'XXXXX'); and $account_id can be same of different?

1 Answers

They have to be the same but you can add other config row with different Property ID (note: the value is Property ID, not Account ID) to send hits simultaneously to several properties.

Related