Skip to content

Conversation

@marktech0813
Copy link

I re-enabled and adjusted the tests. You can run the GA example specs now.

  • Changed describe.skip to describe in both GA specs to re-enable tests.
  • Updated ga-network-stubbing.cy.js to wait for @gifCollect (GET /collect) for the initial pageview instead of @collect (POST j/collect), aligning with current analytics.js behavior.

I re-enabled and adjusted the tests; linter shows no issues. You can run the GA example specs now.
Changed describe.skip to describe in both GA specs to re-enable tests.
Updated ga-network-stubbing.cy.js to wait for @gifCollect (GET /collect) for the initial pageview instead of @collect (POST j/collect), aligning with current analytics.js behavior.
@CLAassistant
Copy link

CLAassistant commented Nov 5, 2025

CLA assistant check
All committers have signed the CLA.

I added a local GA shim in index.html that issues GET requests to https://www.google-analytics.com/collect for pageviews and button events, so the intercepts are triggered even if the real analytics.js can’t load in CI.
Create a project in Cypress Cloud to get a projectId.
Add it to cypress.config.js under e2e.projectId.
Provide a record key (env CYPRESS_RECORD_KEY or --key <record-key>) and keep --record
@AtofStryker AtofStryker self-requested a review November 13, 2025 20:57
Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you @marktech0813 and sorry for the slow turnaround!

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
// lightweight local GA shim that sends expected GET pixel requests
Copy link
Contributor

Choose a reason for hiding this comment

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

do you have a source url where you got this shim from @marktech0813?

viewportWidth: 250,
e2e: {
supportFile: false,
projectId: 'your-cloud-project-id',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
projectId: 'your-cloud-project-id',

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