• Home
    • Pugpig Bolt
    • Content and Workflows

    Adding styles based on in_app query parameter on URL

    Learn how to remove elements of an external website using our in_app query parameter

    Written by Lucy Fairhurst

    Updated at March 26th, 2026

    • Pugpig Bolt

      • Pugpig Site

        • Pugpig Archive

          • Working with Pugpig

            • Pugpig Consulting

              If any element of an external website needs to be excluded e.g header, navigation or footer, this can be achieved by applying additional CSS to the external site that is only set if a query parameter on the URL exists.

              1. Check for query parameter and apply relevant CSS needed e.g css to hide the header and footer
              2. Our standard query parameter is in_app and more. For more detail, see: Sending parameters in a query string to external domains
              3. Note you are responsible for persisting any values (via a cookie) if the user navigates onwards

              Example

              <html>
              <head>
              </head>
              <body>
              	<div class="header">Header</div>
              	<div class="footer">Footer</div>
              	<script>
              		const urlParams = new URLSearchParams(window.location.search);
              		const myParam = urlParams.get('in_app');
              
              		if(myParam !== null){
              		  var styles = `
              		    .header,
              		    .footer { 
              		      display: none; 
              		    }`
              		}
              		var styleSheet = document.createElement("style")
              		styleSheet.type = "text/css"
              		styleSheet.innerText = styles
              		document.head.appendChild(styleSheet)
              </script>
              </body>

              Was this article helpful?

              Yes
              No
              Give feedback about this article

              Related Articles

              • Sending parameters in a query string to external domains
              pugpig logo white
              Navigation
              • Products
              • Customers
              • News
              • Podcast
              Contact
              • Contact us
              • LinkedIn
              • Twitter
              Technical Support
              • Status Page
              • Documentation
              • Customer Support
              Corporate
              • Company
              • Jobs
              • Privacy Policy

              © Kaldor Ltd. 2022

              Powered by Pugpig


              Knowledge Base Software powered by Helpjuice

              Expand