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

Add site health checks for Ads module. #8379

Merged
merged 8 commits into from
Apr 2, 2024

Conversation

benbowler
Copy link
Collaborator

@benbowler benbowler commented Mar 11, 2024

Summary

Addresses issue:

Relevant technical choices

In order to implement ModuleWithTag I had to implement a register_tag function:

/**
* There is no dedicated tag for Ads module.
*/
public function register_tag() {}

I also tested the regex used would capture the provided gtag config call.

This PR returns the Ads Conversion ID to the Site Health Checks but without the tag registered I was not able to see the tag registration check on this page as implemented.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

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

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@benbowler benbowler marked this pull request as ready for review March 11, 2024 19:57
Copy link

github-actions bot commented Mar 11, 2024

Build files for 9758b20 have been deleted.

Copy link
Collaborator

@zutigrm zutigrm left a comment

Choose a reason for hiding this comment

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

Thanks @benbowler LGTM.

I synced this branch with develop since the tag implementation was needed to confirm the behaviour.

I also updated the QAB to describe all cases, and take new tag implementation into account, which now brings the inline comment used to detect that tag is placed by Site Kit.

Note to the Merge reviewer: There is a weird CI only test failure for php 5.6, it might be some glitch, couldn't replicate it locally, and the code change here is very small to affect it

Copy link
Collaborator

@eugene-manuilov eugene-manuilov left a comment

Choose a reason for hiding this comment

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

Thanks, @benbowler. A few comments from me. Please, take a look.

use Module_With_Assets_Trait;
use Module_With_Tag_Trait;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not needed because it is already added to the class.

*
* @since n.e.x.t
*
* @return array
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a description for what is returned from this function to make it consistent with other method phpdocs.


$ads->get_settings()->set( array( 'adsConversionID' => 'AW-123456789' ) );

$this->assertEqualSets(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's also verify that the value is the same as we set in the settings.

@benbowler
Copy link
Collaborator Author

Thanks @eugene-manuilov, updates pushed.

@eugene-manuilov eugene-manuilov merged commit fa16ed0 into develop Apr 2, 2024
25 of 26 checks passed
@eugene-manuilov eugene-manuilov deleted the feature/8245-ads-module-site-health-checks branch April 2, 2024 17:25
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.

3 participants