Skip to content

Conversation

@chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Jan 22, 2026

All Submissions:

Changes proposed in this Pull Request:

Closes https://linear.app/a8c/issue/NPPM-2550/add-ga-to-lite-sites-and-remove-permatters-script and resolves https://a8c.slack.com/archives/C07LB7B14GZ/p1769105774757559

This PR makes a few updates to fix lite site including:

  • Add missing list item bullets
    Screenshot 2026-01-22 at 15 49 12
  • Remove perfmatters delayed scripts
    Screenshot 2026-01-22 at 15 49 39
  • Adds pageview analytics
    Screenshot 2026-01-22 at 15 50 28

How to test the changes in this Pull Request:

More specific list styles

  1. Set up a story with a bulleted list in it.
  2. Enable Lite Site.
  3. View your story - note your list is gone.
  4. Apply this PR.
  5. Refresh your story and confirm your list is back.
  6. Go to you Lite Site homepage and confirm the list of stories does not have bullets, and is nicely spaced out.

Remove perfmatters delayed scripts

  1. Ensure perfmatters is enabled and you are using default newspack settings
  2. Visit a non-lite site page as a reader
  3. Verify the perfmatters script is still present in the page source. (look for perfmatters-delayed-scripts-js)
  4. Visit the lite site as a reader
  5. View page source. On release you will see perfmatters related delayed script. On this branch you will not

Adds GA4 pageview analytics

  1. Ensure site kit is active and setup
  2. Visit the lite site as a reader
  3. View page source. On release there should be no analytics script. On this branch there should be
  4. Visit a few lite site pages, wait a few minutes, then verify the pageviews are present in analytics
  5. Disconnect Site Kit
  6. Verify the analytics snippet is no longer present in lite site

Note: You may need to add the following snippet for the events to send:

add_filter(
	'googlesitekit_allowed_tag_environment_types',
	function( $types ) {
		$types[] = 'local'; // or development
		return $types;
	}
);

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.29.2-hotfix-add-ga-to-lite-site.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@chickenn00dle chickenn00dle changed the base branch from trunk to release January 22, 2026 18:49
@chickenn00dle chickenn00dle marked this pull request as ready for review January 22, 2026 19:40
@chickenn00dle chickenn00dle requested a review from a team as a code owner January 22, 2026 19:40
Copilot AI review requested due to automatic review settings January 22, 2026 19:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes three key updates to fix issues with the lite site functionality: making list styles more specific to avoid removing content lists, disabling Perfmatters script delay on lite site requests, and adding Google Analytics 4 pageview tracking.

Changes:

  • Made CSS selectors for list styles more specific by adding .post-list class to avoid affecting content lists
  • Added filter to disable Perfmatters delayed scripts on lite site requests
  • Integrated GA4 analytics snippet into lite site templates when Google Site Kit is active

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
includes/lite-site/templates/lite-site-styles.php Updated list styles to use .post-list class selector for specificity
includes/lite-site/templates/archive.php Added .post-list class to ul element and GA4 snippet call
includes/lite-site/templates/single.php Added GA4 snippet call to template head
includes/lite-site/class-lite-site.php Added is_lite_site_request() method and get_ga4_snippet() method for analytics
includes/plugins/class-perfmatters.php Added filter to disable JS delay on lite site requests
includes/plugins/google-site-kit/class-googlesitekit.php Changed get_sitekit_ga4_settings() visibility from private to public

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chickenn00dle chickenn00dle added the [Status] Needs Review The issue or pull request needs to be reviewed label Jan 22, 2026
Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

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

Crazy how perfmatters add the js snippet directly to the buffer output, not relying on any filter!

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Jan 22, 2026
@chickenn00dle chickenn00dle merged commit b65e7bc into release Jan 22, 2026
14 checks passed
@chickenn00dle chickenn00dle deleted the hotfix/add-ga-to-lite-site branch January 22, 2026 22:02
matticbot pushed a commit that referenced this pull request Jan 22, 2026
## [6.29.2](v6.29.1...v6.29.2) (2026-01-22)

### Bug Fixes

* lite site updates ([#4417](#4417)) ([b65e7bc](b65e7bc))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.29.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 22, 2026
# [6.30.0-alpha.3](v6.30.0-alpha.2...v6.30.0-alpha.3) (2026-01-22)

### Bug Fixes

* lite site updates ([#4417](#4417)) ([b65e7bc](b65e7bc))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.30.0-alpha.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants