Home > Docs > Javascript solution for running third party scripts

Javascript solution for running third party scripts

Last updated on August 13, 2021

  1. To avoid cache and to execute third party scripts (eg: Google Analytics, Hotjar etc. ) without page reload, you can make use of Javascript solutions.
    • Javascript-based solution for running third party scripts will be enabled by default from version 1.8.9 for new users.
    • Existing users can insert the following filter in the function.php file of active child theme to obtain javascript based execution of scripts.
  2. The plugin provides you with the flexibility to alter or modify the default  behaviour of plugin by the help of javascript codes. That is, it will allow you to show/ hide the cookie bar and enable/ disable blocking based on the user input.
    • You can add support for external integration using the filter in theme’s function.php as given below:
    • For instance, to have GeoIP based settings , that is, to show the cookie notice bar only for a particular region (state-wise/country-wise), you can simply use the below given code snippet in the footer.php file. The below sample code snippet will  show the cookie notice bar and enable script blocking when the visiting country is California.