Project URL: https://www.drupal.org/project/domain_google_analytics
Google Analytics for multidomain.
Description
Add Google Analytics tracking system to your multidomain website. Please see below the steps to configure module.
1) Install/enable domain module (only domain module is required for multidomain GA module)
2) create a domain records on domain config page (http://example.com/admin/config/domain). see below screenshot
3) Now enable the multidomain GA module.
4) add GA code at multidomain GA config page(http://example.com/admin/config/system/multidomain-google-analytics).
5) finally you can checkout GA code at any page by using view source.
Requirements
Google Analytics account
Domain Module
Installation
1) Checkout the 8.x-1.x branch from https://git.drupal.org/project/domain_google_analytics.git
2) Enable the module and go to the configuration page http://example.com/admin/config/system/multidomain-google-analytics.
3) Add GA code for your respective domain and save.
Automated Review done for other Projects:
https://www.drupal.org/node/2870264#comment-12042921
Manual Review done for other Projects:
https://www.drupal.org/node/2871500#comment-12072301
Comment | File | Size | Author |
---|---|---|---|
#21 | Domainscreate.png | 36.16 KB | sushilpal |
#16 | domain.png | 29.84 KB | adrianopulz |
#6 | multidomain-google-analytics.png | 49.67 KB | adrianopulz |
Comments
Comment #2
adrianopulzHi @sushilpal!
Your GIT URL is wrong. I could not clone it.
Please take a look and add a Git command like this:
Project Git Url
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/[your_user]/[node_ID].git
For more details about it see: https://www.drupal.org/node/1011698
Comment #3
sushilpal CreditAttribution: sushilpal commentedComment #4
sushilpal CreditAttribution: sushilpal commentedHi @adrianopulz,
Ohh! my apologies!
Now i have update the url at above. Also you can use http://git.drupal.org/sandbox/sushilpal/2836807.git
Thanks
S
Comment #5
sushilpal CreditAttribution: sushilpal commentedComment #6
adrianopulzNice!
In a first test I found some problems in coding standards and best practices. You can check it using Drupal Coder (https://www.drupal.org/project/coder). To a fast test use it: https://pareview.sh
Take a look in this test: https://pareview.sh/node/1607
Comment #7
deepanker_bhalla CreditAttribution: deepanker_bhalla as a volunteer and at Srijan | A Material+ Company commentedHi sushilpal,
Kindly see the automated review of your project as its showing some errors.
Link: https://pareview.sh/node/1607
Comment #8
sushilpal CreditAttribution: sushilpal commentedComment #9
sushilpal CreditAttribution: sushilpal commentedComment #10
sushilpal CreditAttribution: sushilpal commentedHi @deepanker_bhalla, @drianopulz,
I have fixed all issue of https://pareview.sh/node/1607 except one, please take a look.
I tried but no luck. any help/idea is appreciated.
Thanks
S
Comment #11
adrianopulzHello @sushilpal!
I tried install your module to take a look in Dependency Injection problem but I received a HTTP ERROR 500 after install.
This is the error in my log:
Comment #12
adrianopulz@sushilpal About your Dependency Injection Warning, you will need change that implementation:
$negotiator = \Drupal::service('domain.negotiator');
For it, use your services.yml file to add the '@domain.negotiator' parameter as a argument for your class constructor. So in your GoogleAnalyticResponseSubscriber class constructor you will add this parameter like you was with the $configFactory.
So in line 48 you won't need more use $negotiator = \Drupal::service('domain.negotiator'); instead it use only some like $this->negotiator.
Comment #13
sushilpal CreditAttribution: sushilpal commentedComment #14
sushilpal CreditAttribution: sushilpal commentedHi drianopulz,
I install module again and did not find any error.
This module require the domain module. that's why you got the error.
Thanks
S
Comment #15
sushilpal CreditAttribution: sushilpal commentedhi drianopulz,
Many thanks for your suggestion, i will try your suggestion and let you know if any issue
thanks
S
Comment #16
adrianopulzHi @sushilpal,
About the error I had the module Domain when I installed your module. I think that can be another problem.
When I installed your module only the main module (Domain) is required, so maybe you are using more.
Are you using only these? Take a look:
Comment #17
adrianopulzMaybe a good idea to prevent it, is do something like that:
Comment #18
sushilpal CreditAttribution: sushilpal commentedHi drianopulz,
Actually in my drupal drupal system all domain modules are enabled. that's why i am not getting error.
So now i have uninstall all domain module except domain module and working fine.
I think you need to make a entry on domain configuration page(http://example.com/admin/config/domain). please let me know if it make sense
Thanks
S
Comment #19
sushilpal CreditAttribution: sushilpal commentedHi drianopulz,
thanks for your help, your suggestion did work :)
Now all errors (https://pareview.sh/node/1607) are removed.
Thanks
S
Comment #20
adrianopulz@sushilpal,
After get your updates I uninstall your module and enable all Domain modules. When I enabled your module again I received the error below:
Comment #21
sushilpal CreditAttribution: sushilpal commented@adrianopulz,
Thanks for checking out my module.
I follow the steps mentioned by you above(uninstall/install couple of times) but i did not got any any error or notice. seems something missing.
Please see below the steps.
1) Install/enable domain module (only domain module is required for multidomain GA module)
2) create a domain records on domain config page (http://example.com/admin/config/domain). see below screenshot
3) Now enable the multidomain GA module.
4) add GA code at multidomain GA config page(http://example.com/admin/config/system/multidomain-google-analytics).
5) finally you can checkout GA code at any page by using view source.
Please let me know if still you find any issue.
Thanks
S
Comment #22
adrianopulzHello @sushilpal!
I tested your steps and installed the module without errors.
But normaly when someone will install your module, probably will not have the Domain module installed and configured previously.
So how your module have Domain as a requirement, Drupal will install he first and after that your module automaticaly. After that the Drupal will break and the user cant setup the domain module because all pages are with white screen.
Even if you explain in your module page to setup Domain first is not good user expirence have this error after install in case the user didn't see this rule.
A good solution is resolve it in your code, prevent this error and give to user a way to setup the Domain after install. Maybe in your module configuration page, you can add a message warning the user that he not add your domain yet. And allow the Google Analytics ID field only if exist at least one domain.
Comment #23
narendraRHi Sushil,
You can put a check in GoogleAnalyticResponseSubscriber.php constructor for active domain
You can later ask user on module configuration page to first add domain, so that they can use your module.
Comment #24
sushilpal CreditAttribution: sushilpal commentedComment #25
sushilpal CreditAttribution: sushilpal commented@adrianopulz,
Thanks for suggestion.
I have added steps in description and also handle error from code. Now you can check and let me know if it works for you.
Thanks
S
Comment #26
sushilpal CreditAttribution: sushilpal commented@NarendraR,
thanks for reviewing my code, i have handle the error as per as your suggestion and show the message on multidomain config page if there is no domain records added yet.
Now all seems work for me. Please let me know if any improvement.
Thanks
S
Comment #27
sushilpal CreditAttribution: sushilpal commentedComment #28
adrianopulzHi @sushilpal!
I tested your code again and I didn't have errors to install. At the configuration page I could see the Domain configuration missing and access directly by a link in the message. So sounds good now.
Comment #29
deepanker_bhalla CreditAttribution: deepanker_bhalla as a volunteer and at Srijan | A Material+ Company commentedHi adrianopulz,
should it be RTBC or any other error needs to be worked on?
Comment #30
narendraRHi Sushil,
Module looks good to me. Changing status to RTBC.
Comment #31
adrianopulzHello @sushilpal!
All looks good. @NarendraR changed to RTBC, thanks.
Comment #32
sushilpal CreditAttribution: sushilpal commentedComment #33
sushilpal CreditAttribution: sushilpal commentedComment #34
naveenvalechaThanks for your valuable contribution.
Please specify how this project is different from the google analytics? Please update the issue summary with that, if this is a small feature that can get in google analytics then do that. We encourage collaboration over competition. see https://groups.drupal.org/node/184389#duplicate
There's one also another project https://www.drupal.org/project/domain_analytics Please specify how this project is different from that?
Comment #35
sushilpal CreditAttribution: sushilpal commentedThanks naveen for reply.
Actually this module is works for Multidomain site for D8. As mentioned links for GA module for D7 .
Thanks.
Comment #36
sushilpal CreditAttribution: sushilpal commentedComment #37
PA robot CreditAttribution: PA robot commentedGit clone failed for https://git.drupal.org/sandbox/sushilpal/2836807.git while invoking http://pareview.sh/pareview/httpsgitdrupalorgsandboxsushilpal2836807git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #38
sushilpal CreditAttribution: sushilpal commentedComment #39
sushilpal CreditAttribution: sushilpal commentedGit clone URL is updated.
Comment #40
gaurav_manerkar CreditAttribution: gaurav_manerkar commentedHi @sushilpal module looks proper to me
Comment #41
gaurav_manerkar CreditAttribution: gaurav_manerkar commentedComment #42
sushilpal CreditAttribution: sushilpal commentedthanks gauravmanerkar for updating status to Reviewed & tested by the community.
Comment #43
apadernoThank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #44
apaderno