/analytics/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
-
10/16/19
One property somehow tracks data from other properties as well 0 Recommended Answers 0 Replies 1 Upvote
1 Recommended Answer
$0 Recommended Answers
Hi,
I have a website which has 4 different languages (each with its own domain - .com;.de etc.).
I created separated properties for each domain to track data/users from that specific domain.
The code has if and elseif functions to know which GA needs to fire. Everything works fine but somehow the "main" (.com) property also counts and shows users from other properties/domains...

Do you know how could that be fixed? Here is the code:


?php if($current_lang == "en"): ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXX-2');
</script>

<?php elseif($current_lang == "de"): ?>

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

  gtag('config', 'UA-XXXXX-1');
</script>


        <?php elseif($current_lang == "pl"): ?>

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

              gtag('config', 'UA-XXXXX-3');
            </script>

        <?php elseif($current_lang == "hu"): ?>

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

              gtag('config', 'UA-XXXXX-4');
            </script>




<?php endif; ?>

Thanks :)
No replies yet.
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/analytics/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/analytics/profile/0?hl=ja