Google Tag Manager – To retrieve part of the URL path we

To retrieve part of the URL path, we need to use the custom JS variable. Well, let’s create a JavaScript variable and name it pageUrl. This blog post may look the same as the one I recently published, How to get a search option from a URL, but this time a different problem has been solved. To access the second subdirectory of the URL, you need to enter a custom JavaScript.