• Hi.

    I use your plugin which is quite complete, but I have a casuistry that I don’t know if this plugin can solve.

    I use a landing page where I add a hotjar script.

    I don’t want to add this script on all my pages. Only in 1. But this script is from a third party and generates cookies.

    The question is: is there an option to add a script that generates cookies to a specific page?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @ciltocruz,

    Thanks for using our plugins.

    You can create your own code snippet based on the example below:

    add_action('wp_head',function() {
    	if ( is_page('checkout') && function_exists( 'gdpr_cookie_is_accepted' ) ) {
        if ( gdpr_cookie_is_accepted('thirdparty') ) {
        	?>
        	<script>
        		console.warn('checkout third party snippet');
        	</script>
        	<?php
        }
      }
    });
    
    add_action( 'gdpr_force_reload', '__return_true' );

    If you’re not familiar with the code editing, you can speak to your developers and ask them to implement the custom code snippet for you on the requested landing page.

    The is_page(‘checkout’) is the conditional where the snippet should be inserted, you can simply replace the ‘checkout’ to your landing page slug.

    Hope this helps.

    Thread Starter Marcos Mu?oz Iglesias

    (@ciltocruz)

    It works perfect!

    Thanks!

    Where should i put this code? I need this on thank you single page i have created. But can’t get it to work.

    • This reply was modified 3 years, 7 months ago by pitonar. Reason: notify me
    Thread Starter Marcos Mu?oz Iglesias

    (@ciltocruz)

    In functions.php

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can cookies be added to specific pages?’ is closed to new replies.