Skip to content

Add ga analytics#28

Open
prajwal-pai77 wants to merge 2 commits intomasterfrom
add-ga-analytics
Open

Add ga analytics#28
prajwal-pai77 wants to merge 2 commits intomasterfrom
add-ga-analytics

Conversation

@prajwal-pai77
Copy link
Copy Markdown
Collaborator

  • Add google analytics
  • Add cookie banner

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Docusaurus configuration to include OneTrust cookie consent scripts and tracking via Google Tag Manager and Google Analytics. Feedback was provided regarding a potential domain mismatch for the OneTrust script ID, the redundancy of using both GTM and gtag simultaneously which can cause duplicate tracking, and the unnecessary anonymizeIP setting for GA4 properties.

Comment on lines +33 to +41
// OneTrust Cookies Consent Notice for couchbase.com
headTags: [
{
tagName: 'script',
attributes: {
src: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js',
type: 'text/javascript',
charset: 'UTF-8',
'data-domain-script': '748511ff-10bf-44bf-88b8-36382e5b5fd9',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The OneTrust data-domain-script ID (748511ff-10bf-44bf-88b8-36382e5b5fd9) and the associated comment refer to couchbase.com. However, this site is configured for ruby-cb-orm.com (line 11). OneTrust IDs are domain-specific; using an ID from a different domain will likely cause the cookie banner to fail to load or function incorrectly. Please verify and use the correct ID for the target domain.

Comment on lines +66 to +72
googleTagManager: {
containerId: 'GTM-MVPNN2',
},
gtag: {
trackingID: 'G-CVKKEY0D6B',
anonymizeIP: true,
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Configuring both googleTagManager and gtag simultaneously is generally discouraged. This setup results in both tracking scripts being loaded, which can lead to duplicate event tracking (such as double page views) and negatively impact site performance. You should choose one tracking method. If you prefer GTM, you can manage your GA4 property within the GTM container and remove the gtag block.

Comment on lines +69 to +72
gtag: {
trackingID: 'G-CVKKEY0D6B',
anonymizeIP: true,
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The anonymizeIP option is unnecessary for Google Analytics 4 (GA4) properties (IDs starting with G-). GA4 anonymizes IP addresses by default, and this setting is ignored by the script.

        gtag: {
          trackingID: 'G-CVKKEY0D6B',
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant