custom 404 tracking adobe launch | Community
Skip to main content
Level 2
Sep 10, 2024 9:13 AM UTC
Question

custom 404 tracking adobe launch

How to track custom 404 tracking on websites using adobe launch web sdk , we have added the below steps and yet we get the return value as blanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 3
Sep 10, 2024 11:12 AM UTC

@dineshprasanth Do you have data layer implemented on your site ? If yes than you can fetch the pageName or title from there. Your developer should have named it as 404 not found. That way you can check in the data element if the page title or name is 404 not found and return value as true or false.

If DataLayer is not implemented than you will have to play around DOM scrapping to fetch the value from right element.

Translate
bjoern__koth
New Participant
Sep 10, 2024 9:20 AM UTC

Hi @dineshprasanth 

 

caution: in your example, you are fetching the whole website again which makes little sense and causes unnecessary network traffic and slows down your page.

 

Can you identify the error page somehow, meaning through its document title containing "404" or "error", or any other dom elements on the page which indicate an error?

 

That way you could create a data element that is just returning whether this information was found.

 

In your case of the "404 checker" it would rather look something like this

// use what ever you can use to detect an error page return document.title.includes("404") || document.title.includes("error");

If you cannot identify error pages, ask your developers to make it identifiable.

 

Hope that helps

Translate
Cheers from Switzerland!