Automated testing for events (and page views)

Gold Contributor
Gold Contributor

Hi all,

we have quite a huge number of eventtrackings using the jquery onhandler extension. It's hard to keep an overview and sometimes html or class names change in the frontend. In that case, we lose the tracking and in worst case we don't even realize until someone needs a report for the respective event.

I wonder if other TiQ users have similar issues. Has anybody set up an automated testing environment?

Things I've already checked:

  • Our web analytics tool has a feature that compares tracking metrics to historical data. In case of bigger differences, it sends an alert. Qute good, but a lot of configuring to do. And we sometimes do have events that aren't fired very often. So I'm rather looking for a tool that checks, if the event selector is still present on the website.
  • Our testing team uses selenium and browserstack for frontend testing. Not sure if this could be of use, except for listing a number of example events that this tool might check. But if e.g. a Button is moved to another location on the website, it would report an error.
  • It would be helpful to be able to export the extension parameters/configuration for testing purposes. Setting up each test manually would be quite a drag.

Looking forward to hearing your thoughts! Any idea is welcome!

Best regards,

Bernd

2 REPLIES 2

Automated testing for events (and page views)

Bronze Contributor
Bronze Contributor

Hi Bernd,

I can suggest the following E2E (End-to-End) testing JS library https://www.cypress.io/
We have used this library with great success for testing out GTM setup. Now we are in the process of setting up automated tests using Cypress for Tealium iQ as well. 

Cypress can imitate user journeys on the website, load pages, click buttons, submit forms etc. and at the same time it can verify if the data layer gets populated correctly as well as it can intercept "Networks" tab to validate if tags are firing correctly and events are sent to vendors.

We have been implementing automated Cypress tests for tracking directly into CI/CD deployment pipelines of our WEB products, so tracking tests would run during the deployment process. If tracking tests fail, then the WEBsite deployment gets automatically canceled and developers have to fix tracking before they can redeploy.

You can also create Cypress tests outside CI/CD and run them on a scheduled basis my e.g. using GitHu Actions. However, this will be a reactive way of testing and I would recommend a proactive approach instead and put your tests into CI/CD.

 

PS: There are also other tools similar to Cypress that can do the same job, but they require JS knowledge on a quite good level. But there are also a lot of low/no code testing toold such as e.g. Leapwork. Just keep in mind that low/no code testing tools usually come with limitations, while JS based frameworks like Cypress can do pretty much anything you want :) 

Automated testing for events (and page views)

Gold Contributor
Gold Contributor

Thanks, @IgorPluznikov - I'll definetively have a look at it!

Public