https://cypress.io logo
Testing google analytics tracking codes and id's
# i-need-help
g
Hi. I am trying to test that the proper google analytics codes (UA-121138725-17) and id's (G-R0YBPZ9SKQ) for page views and page events are showing on the google map page: outagemap.ma.nationalgridus.com. I searched and tried a couple things but nothing worked. Does anyone have an example custom command that would test this? One of the screenshots show the old style UA codes and the other shows the new GA style. I need to verify both in my cypress test. Thanks for any help!
g
You could stub them I think like https://glebbahmutov.com/blog/stub-window-track/ or spy on the network calls
g
Thanks Gleb. I'll try that. I also have your networking course. I believe I saw lessons on Stub in there as well. I'll check that out too.