Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The existing module allows to setup a single Tracking Code for multiple top-level domains and collects data through cross domain tracking. This method is difficult to setup and the results are not accurate.
Is it possible to add a separate Tracking Code for each Domain (Domain Access)?
How to do that?
Comments
Comment #2
Londova CreditAttribution: Londova commentedComment #3
hass CreditAttribution: hass commentedYou need to install domain variables module. Than you can configure variables per domain.
Comment #4
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy as a volunteer commentedUpdated the title to show that the issue relates to using the Domain Access module, not to standard multisite configurations.
Comment #5
Londova CreditAttribution: Londova commented@hass
There is NO such module "domain variables" in Drupal 8 (only Drupal 7).
Does it mean that this issue will never be covered by Google Analytics module?
Comment #6
hass CreditAttribution: hass commentedThan you may need to develop domain variables for D8... maybe the migration is in progress... you need to talk with the maintainers. At least I currently think this is not in the scope of the module.
You may also look into https://www.drupal.org/project/domain that may has the feature, too.
Comment #7
golddragon007 CreditAttribution: golddragon007 at Brainsum commentedYou don't need, you can use domain_config modul for D8. There's no UI for this, but if you import in the right way the right config file, it will take effect.
You need to do like this:
domain.config.[domain machine name].google_analytics.settings.yml
You need to write only those keys, which you want to overwrite. In this case this:
account: UA-xxxxxxx-yy
And that's all. (don't forget to import you config file, maybe a cache rebuild needed and a custom cache by domain).