1

Here is a case which I don't know if it is possible in Google Analytics. I have the same domain but wish to have different GA tracking codes.

So, this is the scenario:

  • would like to have a google analytics tracking code for visits on https://mydomain.example or https://mydomain.example/en (I would pick one or the order to collect metrics)

  • would like to have another google analytics tracking code for visits on https://mydomain.example/fr

Is it possible to have different tracking codes based on the URL path? One for English users (/en) and another for French users (/fr)?

1 Answer 1

0

Yes, it's entirely possible to have a different Google Analytics property for every individual page on your website or even two (or more) properties covering the same page.

Implementing it very much depends on how your site's localisation is handled. Perhaps the simplest and most robust solution would be to use GTM and check for the page path when triggering each pageview, so that it is sent to a separate Analytics property.

However, that is perhaps too convoluted and unnecessary. You can simply have the one property and segment the data within it. GA4 is slightly more of a pain to implement, but in UA you could simply set up separate views for each localisation based on the subdirectory name. That would give you a master view (you should always have an unfiltered master view) to see overall performance, and then individual views for each language's directories, all without messing around with different tracking solutions for each langauge.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.