Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Consent Mode once the Ads Conversion ID setting has been migrated to the Ads module. #8365

Closed
1 task
techanvil opened this issue Mar 8, 2024 · 10 comments · Fixed by #8568
Closed
1 task
Labels
Module: Ads Google Ads module related issues P0 High priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Mar 8, 2024

Feature Description

Ensure that the relevant parts of Consent Mode are updated once the Ads Conversion ID setting has been migrated to the Ads module.

Some of this will almost certainly be updated as part of the Ads Module work, this issue is to ensure nothing is missed.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Once the Ads Conversion ID has been migrated to the Ads Module:
    • All references to it in the Consent Mode feature should be updated to use the value from the Ads Module.
    • The confirmation dialog shown when disabling Consent Mode on the Settings screen should be updated to include the Ads module when it's connected.

Implementation Brief

An initial IB has been drafted, to be completed.

  • Ensure the following code snippets are updated to get the adsConversionID from the ads module:

const isAdsConnected = useSelect( ( select ) =>
// TODO: Replace this with the `analytics-4` or `ads` version of the `getAdsConversionID()` selector once it's migrated.
select( MODULES_ANALYTICS ).getAdsConversionID()
);

const isAdsConnected = useSelect( ( select ) =>
// TODO: Replace this with the `analytics-4` or `ads` version of the `getAdsConversionID()` selector once it's migrated.
select( MODULES_ANALYTICS ).getAdsConversionID()
);

const dependentModuleNames = useSelect( ( select ) =>
// TODO: Add the Ads module to this list when the Ads Conversion ID is migrated to it.
[ 'analytics-4' ].reduce( ( names, slug ) => {

Test Coverage

  • Update the assets/js/components/consent-mode/ConsentModeSetupCTAWidget.stories.js story to use the ads store.

QA Brief

  • Setup the Site Kit, enable adsModule feature flag, and connect Analytics and Ads modules
  • Go to the Site Kit settings -> Admin Settings, enable the Consent Mode. Then try to disable it, the popup should mention Ads module in the Note section, together with Analytics "Note: these active modules depend on consent mode and will be affected: Analytics and Ads"
  • Then disconnect the Ads module, and repeat the step above, note section should mention only Analytics as affected module (Ads should be in the list only when active)
  • Verify that Consent mode banner is still appearing when Ads module is active, and not showing when Ads module is not connected
  • Verify that recommended badge is showing in admin settings when Ads module is connected

Changelog entry

  • Ensure that the check for a conversion tracking ID is maintained for the Consent Mode feature with the conversion ID having been migrated to the Ads module.
@techanvil techanvil added Module: Ads Google Ads module related issues P0 High priority Type: Enhancement Improvement of an existing feature labels Mar 8, 2024
@benbowler benbowler self-assigned this Mar 18, 2024
@benbowler
Copy link
Collaborator

I have reviewed the current consent mode for any use of the adsConversionID and all cases are covered in the IB.

@benbowler benbowler removed their assignment Mar 18, 2024
@eugene-manuilov eugene-manuilov self-assigned this Mar 18, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Mar 18, 2024
@mxbclang mxbclang added Team S Issues for Squad 1 and removed Team S Issues for Squad 1 labels Apr 1, 2024
@zutigrm zutigrm self-assigned this Apr 10, 2024
@zutigrm zutigrm removed their assignment Apr 11, 2024
@techanvil techanvil assigned techanvil and zutigrm and unassigned techanvil Apr 12, 2024
@zutigrm zutigrm assigned techanvil and unassigned zutigrm Apr 12, 2024
@techanvil techanvil removed their assignment Apr 15, 2024
@mohitwp mohitwp self-assigned this Apr 16, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Apr 16, 2024

Hi @zutigrm & @techanvil.

It looks like this change in the PR has stopped the consent mode banner from appearing if the Ads module is not connected.

The above change implies that the consent mode banner should only show up if both the Analytics & Ads modules are connected. However, it is possible for Google Ads to be connected even without one of the modules disconnected. Examples:

  1. Analytics module is not connected, but Ads module is connected with an Ads conversion tracking ID.
  2. Ads module is not connected, but Analytics module is connected and:
    1. It is linked with Google Ads (adsLinked) and/or
    2. The connected Google Tag has an Ads conversion ID as one of its destinations.

However, with the above linked change, the banner will only appear if both Ads and Analytics modules are connected, which I think is not right. Thoughts?

@techanvil techanvil assigned zutigrm and mohitwp and unassigned mohitwp and zutigrm Apr 16, 2024
@techanvil
Copy link
Collaborator Author

Thanks @nfmohit, great spot. That one totally slipped by me.

@zutigrm, please can you file a followup PR to update the condition that Nahid's highlighted? It should be returning false if neither of the modules are connected, e.g. along these lines:

if (
  ! (
    isModuleConnected( 'analytics-4' ) || isModuleConnected( 'ads' )
  )
) {
  return false;
}

With this being a release issue we should address this as a priority. Thanks!

@mohitwp, I've moved this back from QA to Execution and assigned it back to Aleksej to address the above.

@techanvil
Copy link
Collaborator Author

techanvil commented Apr 16, 2024

Apologies, I hadn't spotted @zutigrm is off today. @nfmohit has kindly offered to raise a PR to address this.

@nfmohit
Copy link
Collaborator

nfmohit commented Apr 16, 2024

Thanks @nfmohit, great spot. That one totally slipped by me.

@zutigrm, please can you file a followup PR to update the condition that Nahid's highlighted? It should be returning false if neither of the modules are connected, e.g. along these lines:

if (
  ! (
    isModuleConnected( 'analytics-4' ) || isModuleConnected( 'ads' )
  )
) {
  return false;
}

With this being a release issue we should address this as a priority. Thanks!

@mohitwp, I've moved this back from QA to Execution and assigned it back to Aleksej to address the above.

Thank you @techanvil . This is in CR now with a follow-up PR.

@techanvil techanvil self-assigned this Apr 16, 2024
techanvil added a commit that referenced this issue Apr 16, 2024
Fix consent mode Ads connection status logic
@techanvil
Copy link
Collaborator Author

Top stuff, thanks @nfmohit. The PR is now merged, back to you @mohitwp to continue the QA for this one.

@techanvil techanvil reopened this Apr 16, 2024
@techanvil techanvil assigned mohitwp and unassigned techanvil Apr 16, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 17, 2024

QA Update ⚠️

  • Tested on main environment.
  • Hey @nfmohit , according to the QAB Consent mode, the banner only appears if the Ads module is connected, regardless of whether analytics is connected or not. I just want to confirm if this information is correct, especially if the QAB hasn't been updated after recent changes. Could you please review and confirm?

If only Analytics is connected

image

image

Both Analytics and Ads Module connected-

image

Only Ads module is connected -

image

Ads Module connected with Analytics

image

Ads Module connected without Analytics

image

Recommended badge -

image

Recommended badge not showing if analytics is not connected-

image

@nfmohit
Copy link
Collaborator

nfmohit commented Apr 17, 2024

  • Hey @nfmohit , according to the QAB Consent mode, the banner only appears if the Ads module is connected, regardless of whether analytics is connected or not. I just want to confirm if this information is correct, especially if the QAB hasn't been updated after recent changes. Could you please review and confirm?

Hi @mohitwp. That is correct. If the Ads module is connected, we don't need the Analytics module to also be connected in this context. Thanks!

@nfmohit nfmohit removed their assignment Apr 17, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 17, 2024

QA Update ✅

  • Tested on main environment.
  • Verified according to the QAB Consent mode, the banner only appears if the Ads module is connected, regardless of whether analytics is connected or not.
  • Verified Recommended badge is appearing only if Ads module is connected.
  • Verified Copy under disconnect modal is getting update as per which module is active.

If only Analytics is connected

image

image

Both Analytics and Ads Module connected-

image

Only Ads module is connected -

image

Ads Module connected with Analytics

image

Ads Module connected without Analytics

image

Recommended badge -

image

Recommended badge not showing if analytics is not connected-

image

@mohitwp mohitwp removed their assignment Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Ads Google Ads module related issues P0 High priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants