Skip to content

feat: make report Google Analytics configurable - #784

Open
grootstebozewolf wants to merge 5 commits into
allure-framework:mainfrom
grootstebozewolf:fix/476-configurable-analytics
Open

feat: make report Google Analytics configurable#784
grootstebozewolf wants to merge 5 commits into
allure-framework:mainfrom
grootstebozewolf:fix/476-configurable-analytics

Conversation

@grootstebozewolf

@grootstebozewolf grootstebozewolf commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • Add isAnalyticsEnabled() helper in @allurereport/plugin-api (Allure 2 ALLURE_NO_ANALYTICS parity).
  • Promote analyticsEnable to core config (not per-plugin), resolve once in AllureReport, and pass via PluginContext to awesome, classic, dashboard, and allure2 generators so GA can be omitted from report HTML.

Fixes #476

Usage

// allurerc.mjs
export default {
  analyticsEnable: false,
  plugins: {
    awesome: {
      options: {},
    },
  },
};

Or environment (Allure 2 style):

export ALLURE_NO_ANALYTICS=true

Env opt-out wins over the core config option.

Test plan

  • yarn workspace @allurereport/plugin-api test — analytics resolver cases
  • yarn workspace @allurereport/core test — config resolve includes analyticsEnable
  • yarn workspace @allurereport/plugin-allure2 test — generateStaticFiles embeds/omits gtag for default, option false, and env true
  • yarn workspace @allurereport/plugin-awesome test — plugin context fixtures

Allow disabling GA via plugin option analyticsEnable or ALLURE_NO_ANALYTICS
env (Allure 2 parity) across awesome, classic, dashboard, and allure2 reports.
@baev

baev commented Jul 15, 2026

Copy link
Copy Markdown
Member

maybe we should promote analyticsEnabled knob to the core? I don't think we will need to have analytics enabled for one plugin and disabled for the other

grootstebozewolf and others added 4 commits July 17, 2026 08:12
Address PR review feedback: use a single top-level analyticsEnable
knob (plus ALLURE_NO_ANALYTICS env) instead of per-plugin options, and
pass the resolved flag via PluginContext to report generators.
Bring fix/476-configurable-analytics up to date with allure-framework/main
and keep core analyticsEnable wiring in allure2/awesome/classic generators.
@just-boris

Copy link
Copy Markdown

Hello team

It seems like the review comment has been addressed. is there anything else preventing release of this?

This missing flag is a blocker for some teams looking to upgrade to Allure v3

@baev

baev commented Aug 12, 2026

Copy link
Copy Markdown
Member

BTW I would rename analyticsEnable -> analyticsDisable so the default/non provided value match the default behaviour

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Google Analytics generation configurable (as in Allure 2)

3 participants