Cypress and Adobe Analytics Failure | Community
Skip to main content
July 3, 2023
Solved

Cypress and Adobe Analytics Failure

  • July 3, 2023
  • 2 replies
  • 2360 views

I am using Cypress automation, at the moment I am testing/writing tests for Analytics. With Google Analytics I was easily able to write my tests using cy.intercept() function and was successfully able to assert Google Analytics. But... with Adobe Analtics the cy.intercept() function doesn't see Adobe Analytics. I been researching solutions with no luck, 1. there is very little info 2. their solutions suggest to use cy.interept(). Here is what I have so far: 

The prior steps are to login the website and turn on Adobe Analytics. Then I am supposed to assert that Adobe Analytics are up and running. I am using this: 

 

 

 

cy.intercept('POST', 'your_website', { statusCode: 200 }).as('adobe-analytics') cy.wait(5000) cy.log('**Step 6**') cy.waitForStableDOM({timeout: 55000}) cy.wait(5000) cy.wait('@adobe-analytics').get('@adobe-analytics') .then((xhr) =>{ console.log("Adobe-Analytics Response:", xhr) })

 

 

Where it fails is at cy.wait('@adobe-analytics') and the response I get that the 1sst request to the route: @61380-analytics no request ever occurred. 
Any help is appreciated. 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ArthurMa2

THANK YOU!!! . What it was was the long website name I added in the cy.intercept() 

example: 

So, I followed what you did and got rid of 'POST' and changed the intercept to: 
'/b/ss/**' and it worked. 
It looks like this now: 
cy.intercept('/b/ss/**',).as('adobe-analytics') = Boom! It works!
Now, I'm able to pull any info off of it! 
Thank you so much!!!
 

2 replies

yuhuisg
Community Advisor
Community Advisor
July 7, 2023

This worked for me:

 

describe('detect Adobe Analytics request', () => { it('visits a webpage', () => { // specify the intercept first cy.intercept( '/b/ss/**', ).as('adobeAnalyticsRequest'); // then load the web page to be tested cy.visit('https://www.website.com'); // then check for the AA request cy.get('@adobeAnalyticsRequest').then((req) => { console.log('adobeAnalyticsRequest', req); }); }); });

Strangely, if I call cy.visit() before cy.intercept(), then the AA request does not get intercepted. But this also happens with other network requests, so it's not an AA-specific issue.

 

ArthurMa2AuthorAccepted solution
July 7, 2023

THANK YOU!!! . What it was was the long website name I added in the cy.intercept() 

example: 

So, I followed what you did and got rid of 'POST' and changed the intercept to: 
'/b/ss/**' and it worked. 
It looks like this now: 
cy.intercept('/b/ss/**',).as('adobe-analytics') = Boom! It works!
Now, I'm able to pull any info off of it! 
Thank you so much!!!
 
yuhuisg
Community Advisor
Community Advisor
July 7, 2023

You're welcome!

But actually, I want to thank you too for "introducing" Cypress to me (although an introduction wasn't your post's intention). I had been looking for an automation tool that works like Selenium but better, and now thanks to your post, I've found it! 😁

birlaadvaya
December 15, 2023

Cost savings, integration with other Google services, user-friendly interfaces, and powerful data visualizations are often factors in the switch from Adobe Analytics to Google Analytics 360. For many companies is, Google Analytics 360 is more affordable and easily available than the Adobe platform Like Birla Advaya as an alternative. Its smooth integration with other Google products like , and Google Ads simplify data management and reporting to further encourage the conversion.