is_page ) { $cat = is_front_page() ? 'Front' : 'Page'; } elseif ( $wp_query->is_home ) { $cat = 'Home Page'; } elseif ( $wp_query->is_single ) { $cat = ( $wp_query->is_attachment ) ? 'attachment' : 'Blog Post'; } elseif ( $wp_query->is_category ) { $cat = 'Category'; } elseif ( $wp_query->is_tag ) { $cat = 'Tag'; } elseif ( $wp_query->is_tax ) { $cat = 'Taxonomy'; } elseif ( $wp_query->is_archive ) { if ( $wp_query->is_day ) { $cat = 'Day Archive'; } elseif ( $wp_query->is_month ) { $cat = 'Month Archive'; } elseif ( $wp_query->is_year ) { $cat = 'Year Archive'; } elseif ( $wp_query->is_author ) { $cat = 'Author'; } else { $cat = 'Archive'; } } elseif ( $wp_query->is_search ) { $cat = 'Search'; } elseif ( $wp_query->is_404 ) { $cat = '404 Page'; } return $cat; } ?>

Rewrite a fragment based URL with Google Tag Manager for better Site Search in Google Analytics

Woman searching for something on her laptop

hew, that is possibly the longest title I’ve ever written, but there’s always a first for everything. Today we are going to have a look at a scenario where I found the URL used while doing a site search on a site wasn’t really optimal to push into Google Analytics. In my case, the URL … Read more

Try Jasper AI (Free Trial)

Create amazing blog posts and marketing copy using extremely well performing templates.
Get original content 10X faster with AI.

© 2023 Daniel Carlbom