SlideShare a Scribd company logo
Using an end-to-end testing tool to
validate website analytics
implementations
Superweek 2023
2 06-02-2023
Who am I?
Peter Meyer
Implementation Lead
Aller Media Denmark
Have worked at
Aller Media (now twice), DFDS, IIH Nordic,
Nordea, Jellyfish, GN ReSound, …
Yes, I have several ex-colleagues here today ;-)
Knows something about
Implementation, setup, and use, of products like
Google Tag Manager, Google Analytics, Adobe
Analytics, Tealium iQ, Tealium AudienceStream,
and more…
Me, artistic portrait by Vana
3 06-02-2023
Where do I work?
Aller Media
• A publishing company founded in 1873
(by the two young folks to the right)
• Separate companies in Denmark, Sweden,
Finland and Norway
• Leading publisher of magazines and weeklies in
Denmark and the Nordics
• Oldest weekly magazine in Denmark
(1874 – present day)
• Informing and entertaining more than
2 million Danes every month of the year
• Publisher of Danish household brands such as
SE og HØR, BILLED-BLADET, femina, and
ELLE
Laura and Carl Aller, 1873’ish
What is
End-to-End
testing?
06-02-2023
5
E2E
Integration
Unit
Individual parts of source code
Source code working together
User journeys
Headless browser
Maybe included in an
automated build process
Visible browser
For you to see while it runs
8 06-02-2023
End-to-End testing products
• Cypress
https://www.cypress.io/
Node.js based (JavaScript and TypeScript), nice
UI for visible test runs.
• Playwright (Microsoft)
https://playwright.dev/
More browsers, platforms and languages
supported.
• Puppeteer (Google)
https://developer.chrome.com/docs/puppeteer/Nod
e.js based, only supporting Chrome browser
testing.
• Selenium
https://www.selenium.dev/
The “old-school” end-to-end testing product.
Supports languages like Java, Python, C#.
• Leapwork
https://www.leapwork.com/
No-code testing product.
No free options available.
• And more…
= Supported by BrowserStack Automate
06-02-2023
9
E2E
Integration
Unit
Individual parts of source code
Source code working together
User journeys
?
06-02-2023
10
E2E
Integration
Unit
Individual parts of source code
Source code working together
User journeys
Tracking
So, what’s Cypress
all about?
12
06-02-2023
What will
we test today?
• What we test
14 06-02-2023
Where we test
https://pmeyer.dk
• My own private blog.
• A static Hugo generated site.
Implemented analytics products
• Google Tag Manager
• Page information pushed to data layer
• Google Analytics 4
• Enhanced measurement
(using default settings)
15 06-02-2023
What we test
After page load
• GTM: Page information in data layer
• GA4: “page_view” event request
After scroll to bottom of page
• GTM: “gtm.scrollDepth” event in data layer
• GA4: “scroll” event request
After click on Twitter social link
• GA4: “click” event request
Running
the tests
Let’s have a look
at some of the code
Scroll to bottom of page and check footer visibility
Scroll to a position and check an item on the page.
22 06-02-2023
it('Scroll to bottom of page and check footer visibility', () => {
// Scroll to bottom of page
cy.scrollTo('bottom', {
ensureScrollable: false,
easing: 'linear',
duration: 2000,
});
// Check for footer visibility
cy.get('.footer').should('be.visible');
});
Scroll to bottom of page
Check that the footer element exists
in the DOM and is visible
Check Twitter social link and click it
Get, check, and click, an item on the page.
23 06-02-2023
it('Check Twitter social link and click it', () => {
cy.get('a[title=Twitter]').then((element) => {
// Check link attributes
const twitterLink = element[0];
assert.equal(twitterLink.className, 'widget-social__link widget__link btn',
'Link className contains expected value');
assert.equal(twitterLink.href, 'https://twitter.com/pmeyerdk',
'Link href contains expected value');
assert.equal(twitterLink.target, '_blank',
'Link target contains expected value');
});
// Click link
cy.get('a[title=Twitter]').click();
});
Check element attributes
for expected values
Clicking the element
Checking the GTM Data Layer and its content
24 06-02-2023
it(‘Has a dataLayer and loads GTM', () => {
// Check Data Layer existance and 'gtm.js' event item
cy.window().then((window) => {
assert.isDefined(window.dataLayer, 'Data Layer is defined');
assert.isDefined(window.dataLayer.find(x => x.event === 'gtm.js'), 'GTM is loaded');
});
});
it(‘Has correct dataLayer contents at load time', () => {
// Check for initial Data Layer item and expected parameters
cy.window().then((window) => {
const dataLayer = window.dataLayer[0];
assert.deepInclude(dataLayer, {
'page_author': 'Peter Meyer',
'page_kind': 'home',
'page_language': 'en',
'page_permalink': 'http://pmeyer.dk/',
'page_title': 'PMEYERDK',
'page_translated': false,
'page_type': 'page',
}, 'Expected parameters found in Data Layer at load time');
});
});
Check GTM load event
Check parameters for
expected values in the
initial Data Layer push
Intercept and block all GA4 requests
Code included here runs before each test.
beforeEach(function () {
cy.intercept({
url: 'https://**.google-analytics.com/g/collect?v=2&**'
},
{
statusCode: 503
}).as('ga4Request');
});
25 06-02-2023
Define a default response for the
intercepted requests
Intercept requests based on
wildcard URLs
Set an alias for the interception
Load page and wait for GA4 ‘page_view’ event
Here we also check for expected event payload.
26 06-02-2023
it('Load page and check for GA4 'page_view' event', () => {
// Load blog home page
cy.visit(cfg.pages.home);
// Wait for GA4 'page_view' event to be sent
cy.wait('@ga4Request').then(({ request }) => {
const qsParams = qsToObject(request.url);
assert.isDefined(qsParams, 'Query string is defined');
assert.deepInclude(qsParams, {
'tid': cfg.gaMeasurementId,
'en': 'page_view',
'dl': cfg.pages.home,
}, 'Query string contains expected parameters');
})
});
Wait for the GA4
“page_view” request and
check its payload
Visit the homepage of my blog
Let’s sum up.
28 06-02-2023
Thank you for inspiration, tips and help along the way
• David Vallejo
Send GA4 events to multiple Measurement IDs:
https://www.thyngster.com/send-google-analytics-
4-ga4-events-to-multiple-measurement-ids
• Dumky de Wilde
Testing GTM and UA using Cypress (+chat about
same): https://www.dumky.net/posts/analytics-
and-tag-testing-with-cypress/
• Lukas Oldenburg
Testing Tealium iQ implementations:
https://thebounce.io/using-mocha-chai-js-tealium-
for-client-side-data-layer-testing-9eea7807942a
• Simo Ahava
Testing GTM using PhantomJS:
https://www.simoahava.com/analytics/automated
-tests-for-google-tag-managers-datalayer/
• Gleb Bahmutov
Cypress knowledge, loads of examples, tips &
tricks: https://glebbahmutov.com/cypress-
examples/
• Cypress
For Cypress itself: https://www.cypress.io/
• And more…
Thanks!
Peter Meyer
Implementation Lead
Aller Media Denmark
Twitter
https://twitter.com/pmeyerdk
Mastodon
https://masto.measure.chat/@pmeyerdk
LinkedIn
https://www.linkedin.com/in/pmeyerdk

More Related Content

What's hot

Find Profitable Keywords In Less Than 5 Minutes Without Spending Anything
Find Profitable Keywords In Less Than 5 Minutes Without Spending AnythingFind Profitable Keywords In Less Than 5 Minutes Without Spending Anything
Find Profitable Keywords In Less Than 5 Minutes Without Spending Anything
Fervil Von Tripoli
 
Page Object in XCUITest
Page Object in XCUITestPage Object in XCUITest
Page Object in XCUITest
Jz Chang
 
I Am A Donut: How to Avoid International SEO Mistakes
I Am A Donut: How to Avoid International SEO MistakesI Am A Donut: How to Avoid International SEO Mistakes
I Am A Donut: How to Avoid International SEO Mistakes
Tom Brennan
 
More research, more frequently: How to sell your stakeholders on research
More research, more frequently: How to sell your stakeholders on researchMore research, more frequently: How to sell your stakeholders on research
More research, more frequently: How to sell your stakeholders on research
Chris Avore
 
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Koray Tugberk GUBUR
 
Why Scaling (Great) Content Is So Bloody Hard
Why Scaling (Great) Content Is So Bloody HardWhy Scaling (Great) Content Is So Bloody Hard
Why Scaling (Great) Content Is So Bloody Hard
Ahrefs
 
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
Distilled
 
Google Analytics for Dummies
Google Analytics for DummiesGoogle Analytics for Dummies
Google Analytics for Dummies
Tim Lelek
 
Internal Linking - The Topic Clustering Way edited.pptx
Internal Linking - The Topic Clustering Way edited.pptxInternal Linking - The Topic Clustering Way edited.pptx
Internal Linking - The Topic Clustering Way edited.pptx
Dixon Jones
 
Crawling, indexation & the impact on performance | Brighton SEO
Crawling, indexation & the impact on performance | Brighton SEOCrawling, indexation & the impact on performance | Brighton SEO
Crawling, indexation & the impact on performance | Brighton SEO
Martin Sean Fennon
 
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
Taste
 
SEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
SEO Case Study - Hangikredi.com From 12 March to 24 September Core UpdateSEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
SEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
Koray Tugberk GUBUR
 
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEOSearch Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Koray Tugberk GUBUR
 
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
Sophie Gibson
 
Debugging rendering problems at scale
Debugging rendering problems at scaleDebugging rendering problems at scale
Debugging rendering problems at scale
Giacomo Zecchini
 
Google Tag Manager.pptx
Google Tag Manager.pptxGoogle Tag Manager.pptx
Google Tag Manager.pptx
PrashantThakur678201
 
One Further - Spektrix and Google Analytics 4
One Further - Spektrix and Google Analytics 4One Further - Spektrix and Google Analytics 4
One Further - Spektrix and Google Analytics 4
One Further
 
40 Deep #SEO Insights for 2023
40 Deep #SEO Insights for 202340 Deep #SEO Insights for 2023
40 Deep #SEO Insights for 2023
Koray Tugberk GUBUR
 
Content writers: will AI take your job?
Content writers: will AI take your job?Content writers: will AI take your job?
Content writers: will AI take your job?
KatieThompson74137
 
Ist Google Analytics noch zu retten?
Ist Google Analytics noch zu retten?Ist Google Analytics noch zu retten?
Ist Google Analytics noch zu retten?
📊 Markus Baersch
 

What's hot (20)

Find Profitable Keywords In Less Than 5 Minutes Without Spending Anything
Find Profitable Keywords In Less Than 5 Minutes Without Spending AnythingFind Profitable Keywords In Less Than 5 Minutes Without Spending Anything
Find Profitable Keywords In Less Than 5 Minutes Without Spending Anything
 
Page Object in XCUITest
Page Object in XCUITestPage Object in XCUITest
Page Object in XCUITest
 
I Am A Donut: How to Avoid International SEO Mistakes
I Am A Donut: How to Avoid International SEO MistakesI Am A Donut: How to Avoid International SEO Mistakes
I Am A Donut: How to Avoid International SEO Mistakes
 
More research, more frequently: How to sell your stakeholders on research
More research, more frequently: How to sell your stakeholders on researchMore research, more frequently: How to sell your stakeholders on research
More research, more frequently: How to sell your stakeholders on research
 
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
 
Why Scaling (Great) Content Is So Bloody Hard
Why Scaling (Great) Content Is So Bloody HardWhy Scaling (Great) Content Is So Bloody Hard
Why Scaling (Great) Content Is So Bloody Hard
 
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
SearchLove San Diego 2018 | Will Critchlow | From the Horse’s Mouth: What We ...
 
Google Analytics for Dummies
Google Analytics for DummiesGoogle Analytics for Dummies
Google Analytics for Dummies
 
Internal Linking - The Topic Clustering Way edited.pptx
Internal Linking - The Topic Clustering Way edited.pptxInternal Linking - The Topic Clustering Way edited.pptx
Internal Linking - The Topic Clustering Way edited.pptx
 
Crawling, indexation & the impact on performance | Brighton SEO
Crawling, indexation & the impact on performance | Brighton SEOCrawling, indexation & the impact on performance | Brighton SEO
Crawling, indexation & the impact on performance | Brighton SEO
 
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
Data Restart 2021: Roman Appeltauer - Server-side GTM je skutečně víc než jen...
 
SEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
SEO Case Study - Hangikredi.com From 12 March to 24 September Core UpdateSEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
SEO Case Study - Hangikredi.com From 12 March to 24 September Core Update
 
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEOSearch Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
 
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
Competitor Site Audits with Free Tools and Data - Sophie Gibson - BrightonSEO...
 
Debugging rendering problems at scale
Debugging rendering problems at scaleDebugging rendering problems at scale
Debugging rendering problems at scale
 
Google Tag Manager.pptx
Google Tag Manager.pptxGoogle Tag Manager.pptx
Google Tag Manager.pptx
 
One Further - Spektrix and Google Analytics 4
One Further - Spektrix and Google Analytics 4One Further - Spektrix and Google Analytics 4
One Further - Spektrix and Google Analytics 4
 
40 Deep #SEO Insights for 2023
40 Deep #SEO Insights for 202340 Deep #SEO Insights for 2023
40 Deep #SEO Insights for 2023
 
Content writers: will AI take your job?
Content writers: will AI take your job?Content writers: will AI take your job?
Content writers: will AI take your job?
 
Ist Google Analytics noch zu retten?
Ist Google Analytics noch zu retten?Ist Google Analytics noch zu retten?
Ist Google Analytics noch zu retten?
 

Similar to Using an end-to-end testing tool to validate website analytics implementations - Superweek 2023

Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag Manager
Phil Pearce
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...
Eventz.Digital
 
Advanced Remarketing in Google Analytics Using CRM Data
Advanced Remarketing in Google Analytics Using CRM DataAdvanced Remarketing in Google Analytics Using CRM Data
Advanced Remarketing in Google Analytics Using CRM Data
metricmogul
 
Scaling business app development with Play and Scala
Scaling business app development with Play and ScalaScaling business app development with Play and Scala
Scaling business app development with Play and Scala
Peter Hilton
 
Snowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your businessSnowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your business
yalisassoon
 
JSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa TechfestJSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa Techfest
Matthew Groves
 
Big query
Big queryBig query
Big query
Tanvi Parikh
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13
MongoDB
 
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack SissonMongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
Hakka Labs
 
Snowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your businessSnowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your business
Giuseppe Gaviani
 
What I learned about firebase analytics
What I learned about firebase analyticsWhat I learned about firebase analytics
What I learned about firebase analytics
Nick Guebhard
 
Marketo: hands on with Google Analytics
Marketo: hands on with Google AnalyticsMarketo: hands on with Google Analytics
Marketo: hands on with Google Analytics
Stijn Heijthuijsen
 
Data Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BIData Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BI
Marcelo Gazzola Ribeiro
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query Basics
Ido Green
 
[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content
William Hugo Yang
 
Google Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQueryGoogle Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQuery
CARTO
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
wesley chun
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
Rubén Martínez
 
Using MongoDB As a Tick Database
Using MongoDB As a Tick DatabaseUsing MongoDB As a Tick Database
Using MongoDB As a Tick Database
MongoDB
 
Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?
Itai Yaffe
 

Similar to Using an end-to-end testing tool to validate website analytics implementations - Superweek 2023 (20)

Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag Manager
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...
 
Advanced Remarketing in Google Analytics Using CRM Data
Advanced Remarketing in Google Analytics Using CRM DataAdvanced Remarketing in Google Analytics Using CRM Data
Advanced Remarketing in Google Analytics Using CRM Data
 
Scaling business app development with Play and Scala
Scaling business app development with Play and ScalaScaling business app development with Play and Scala
Scaling business app development with Play and Scala
 
Snowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your businessSnowplow: evolve your analytics stack with your business
Snowplow: evolve your analytics stack with your business
 
JSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa TechfestJSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa Techfest
 
Big query
Big queryBig query
Big query
 
Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13Content Delivery at Aviary - NYC MUG 11/19/13
Content Delivery at Aviary - NYC MUG 11/19/13
 
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack SissonMongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
MongoDB and Content Delivery at Aviary by Nir Zicherman and Jack Sisson
 
Snowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your businessSnowplow - Evolve your analytics stack with your business
Snowplow - Evolve your analytics stack with your business
 
What I learned about firebase analytics
What I learned about firebase analyticsWhat I learned about firebase analytics
What I learned about firebase analytics
 
Marketo: hands on with Google Analytics
Marketo: hands on with Google AnalyticsMarketo: hands on with Google Analytics
Marketo: hands on with Google Analytics
 
Data Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BIData Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BI
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query Basics
 
[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content
 
Google Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQueryGoogle Analytics location data visualised with CARTO & BigQuery
Google Analytics location data visualised with CARTO & BigQuery
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
 
Using MongoDB As a Tick Database
Using MongoDB As a Tick DatabaseUsing MongoDB As a Tick Database
Using MongoDB As a Tick Database
 
Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?Optimizing Spark-based data pipelines - are you up for it?
Optimizing Spark-based data pipelines - are you up for it?
 

Recently uploaded

reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdfreading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
perranet1
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
osoyvvf
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
TeukuEriSyahputra
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
PsychoTech Services
 
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENTHigh Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
ranjeet3341
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
nhutnguyen355078
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
Marlon Dumas
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
Alireza Kamrani
 
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your DoorAhmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
Russian Escorts in Delhi 9711199171 with low rate Book online
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
nyvan3
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
ywqeos
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
uevausa
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
Vineet
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
hqfek
 
Bangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts ServiceBangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts Service
nhero3888
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
Vineet
 
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
Timothy Spann
 

Recently uploaded (20)

reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdfreading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
reading_sample_sap_press_operational_data_provisioning_with_sap_bw4hana (1).pdf
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
Essential Skills for Family Assessment - Marital and Family Therapy and Couns...
 
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENTHigh Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
High Profile Call Girls Navi Mumbai ✅ 9833363713 FULL CASH PAYMENT
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
Discovering Digital Process Twins for What-if Analysis: a Process Mining Appr...
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
 
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your DoorAhmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
Ahmedabad Call Girls 7339748667 With Free Home Delivery At Your Door
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
 
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
一比一原版(lbs毕业证书)伦敦商学院毕业证如何办理
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
 
Bangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts ServiceBangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts Service
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
 
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
 

Using an end-to-end testing tool to validate website analytics implementations - Superweek 2023

  • 1. Using an end-to-end testing tool to validate website analytics implementations Superweek 2023
  • 2. 2 06-02-2023 Who am I? Peter Meyer Implementation Lead Aller Media Denmark Have worked at Aller Media (now twice), DFDS, IIH Nordic, Nordea, Jellyfish, GN ReSound, … Yes, I have several ex-colleagues here today ;-) Knows something about Implementation, setup, and use, of products like Google Tag Manager, Google Analytics, Adobe Analytics, Tealium iQ, Tealium AudienceStream, and more… Me, artistic portrait by Vana
  • 3. 3 06-02-2023 Where do I work? Aller Media • A publishing company founded in 1873 (by the two young folks to the right) • Separate companies in Denmark, Sweden, Finland and Norway • Leading publisher of magazines and weeklies in Denmark and the Nordics • Oldest weekly magazine in Denmark (1874 – present day) • Informing and entertaining more than 2 million Danes every month of the year • Publisher of Danish household brands such as SE og HØR, BILLED-BLADET, femina, and ELLE Laura and Carl Aller, 1873’ish
  • 5. 06-02-2023 5 E2E Integration Unit Individual parts of source code Source code working together User journeys
  • 6. Headless browser Maybe included in an automated build process Visible browser For you to see while it runs
  • 7.
  • 8. 8 06-02-2023 End-to-End testing products • Cypress https://www.cypress.io/ Node.js based (JavaScript and TypeScript), nice UI for visible test runs. • Playwright (Microsoft) https://playwright.dev/ More browsers, platforms and languages supported. • Puppeteer (Google) https://developer.chrome.com/docs/puppeteer/Nod e.js based, only supporting Chrome browser testing. • Selenium https://www.selenium.dev/ The “old-school” end-to-end testing product. Supports languages like Java, Python, C#. • Leapwork https://www.leapwork.com/ No-code testing product. No free options available. • And more… = Supported by BrowserStack Automate
  • 9. 06-02-2023 9 E2E Integration Unit Individual parts of source code Source code working together User journeys ?
  • 10. 06-02-2023 10 E2E Integration Unit Individual parts of source code Source code working together User journeys Tracking
  • 14. • What we test 14 06-02-2023 Where we test https://pmeyer.dk • My own private blog. • A static Hugo generated site. Implemented analytics products • Google Tag Manager • Page information pushed to data layer • Google Analytics 4 • Enhanced measurement (using default settings)
  • 15. 15 06-02-2023 What we test After page load • GTM: Page information in data layer • GA4: “page_view” event request After scroll to bottom of page • GTM: “gtm.scrollDepth” event in data layer • GA4: “scroll” event request After click on Twitter social link • GA4: “click” event request
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Let’s have a look at some of the code
  • 22. Scroll to bottom of page and check footer visibility Scroll to a position and check an item on the page. 22 06-02-2023 it('Scroll to bottom of page and check footer visibility', () => { // Scroll to bottom of page cy.scrollTo('bottom', { ensureScrollable: false, easing: 'linear', duration: 2000, }); // Check for footer visibility cy.get('.footer').should('be.visible'); }); Scroll to bottom of page Check that the footer element exists in the DOM and is visible
  • 23. Check Twitter social link and click it Get, check, and click, an item on the page. 23 06-02-2023 it('Check Twitter social link and click it', () => { cy.get('a[title=Twitter]').then((element) => { // Check link attributes const twitterLink = element[0]; assert.equal(twitterLink.className, 'widget-social__link widget__link btn', 'Link className contains expected value'); assert.equal(twitterLink.href, 'https://twitter.com/pmeyerdk', 'Link href contains expected value'); assert.equal(twitterLink.target, '_blank', 'Link target contains expected value'); }); // Click link cy.get('a[title=Twitter]').click(); }); Check element attributes for expected values Clicking the element
  • 24. Checking the GTM Data Layer and its content 24 06-02-2023 it(‘Has a dataLayer and loads GTM', () => { // Check Data Layer existance and 'gtm.js' event item cy.window().then((window) => { assert.isDefined(window.dataLayer, 'Data Layer is defined'); assert.isDefined(window.dataLayer.find(x => x.event === 'gtm.js'), 'GTM is loaded'); }); }); it(‘Has correct dataLayer contents at load time', () => { // Check for initial Data Layer item and expected parameters cy.window().then((window) => { const dataLayer = window.dataLayer[0]; assert.deepInclude(dataLayer, { 'page_author': 'Peter Meyer', 'page_kind': 'home', 'page_language': 'en', 'page_permalink': 'http://pmeyer.dk/', 'page_title': 'PMEYERDK', 'page_translated': false, 'page_type': 'page', }, 'Expected parameters found in Data Layer at load time'); }); }); Check GTM load event Check parameters for expected values in the initial Data Layer push
  • 25. Intercept and block all GA4 requests Code included here runs before each test. beforeEach(function () { cy.intercept({ url: 'https://**.google-analytics.com/g/collect?v=2&**' }, { statusCode: 503 }).as('ga4Request'); }); 25 06-02-2023 Define a default response for the intercepted requests Intercept requests based on wildcard URLs Set an alias for the interception
  • 26. Load page and wait for GA4 ‘page_view’ event Here we also check for expected event payload. 26 06-02-2023 it('Load page and check for GA4 'page_view' event', () => { // Load blog home page cy.visit(cfg.pages.home); // Wait for GA4 'page_view' event to be sent cy.wait('@ga4Request').then(({ request }) => { const qsParams = qsToObject(request.url); assert.isDefined(qsParams, 'Query string is defined'); assert.deepInclude(qsParams, { 'tid': cfg.gaMeasurementId, 'en': 'page_view', 'dl': cfg.pages.home, }, 'Query string contains expected parameters'); }) }); Wait for the GA4 “page_view” request and check its payload Visit the homepage of my blog
  • 28. 28 06-02-2023 Thank you for inspiration, tips and help along the way • David Vallejo Send GA4 events to multiple Measurement IDs: https://www.thyngster.com/send-google-analytics- 4-ga4-events-to-multiple-measurement-ids • Dumky de Wilde Testing GTM and UA using Cypress (+chat about same): https://www.dumky.net/posts/analytics- and-tag-testing-with-cypress/ • Lukas Oldenburg Testing Tealium iQ implementations: https://thebounce.io/using-mocha-chai-js-tealium- for-client-side-data-layer-testing-9eea7807942a • Simo Ahava Testing GTM using PhantomJS: https://www.simoahava.com/analytics/automated -tests-for-google-tag-managers-datalayer/ • Gleb Bahmutov Cypress knowledge, loads of examples, tips & tricks: https://glebbahmutov.com/cypress- examples/ • Cypress For Cypress itself: https://www.cypress.io/ • And more…
  • 29. Thanks! Peter Meyer Implementation Lead Aller Media Denmark Twitter https://twitter.com/pmeyerdk Mastodon https://masto.measure.chat/@pmeyerdk LinkedIn https://www.linkedin.com/in/pmeyerdk