Title: Inserting a code
Last modified: September 19, 2018

---

# Inserting a code

 *  Resolved Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/)
 * A marketing company through which I have ad banners on my website has asked me
   to insert a wrapper code in my GDPR Plugin that will sent to them the visitors’
   cookie consent in compliance with the new privacy laws.
 * They asked me to insert this code “to the onclick event of the green ‘Accept’
   button”.
 * I can’t copy this code here for privacy reasons (it is developed for my ads).
 * My question is – how / where will I find ‘the onlick event of the Accept button”
   and will I be able to insert this code?
 * grateful for advice.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finserting-a-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10709701)
 * Hi @magicpowers,
 * As per our understanding, you are required to add a code to the click response
   of cookie accept button to collect the response To set this up, please add the
   below code snippet to your theme’s footer file.
 *     ```
       <script>
       jQuery('.cli_action_button').click(function(e){
           e.preventDefault();
           var elm=jQuery(this);
           var button_action=elm.attr('data-cli_action');
           if(button_action=='accept')
           {
   
               //code for accept button click goes here
   
           }else if(button_action=='reject')
           {
               //code for reject button click goes here
           }
       });
       </script>
       ```
   
 * You can add your code to the commented section. Kindly ensure that you are adding
   the code snippet after including the JQuery in theme file.
 * Let us know if any assistance required.
 *  Thread Starter Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10710097)
 * Hi
 * Many thanks. I need to ask them for the code for the rejection button as well,
   or separate the two.
 * Question – why do you ask me to add this code in the theme’s FOOTER? I have my
   consent button set up in the header. Does it matter?
 * So would this be in the footer.php or header.php? on which line? at the end?
 * I would appreciate your advice.
 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10710207)
 * Hi @magicpowers,
 * You can add it to the end of the footer.php. It will work even if the settings
   is for header.
 *  Thread Starter Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10710270)
 * hi [@webtoffee](https://wordpress.org/support/users/webtoffee/)
 * ok thank you.
    Now I need to wait for the reply from the marketer with the correct
   code.
 * Just in case I will ask – since they have provided only one code for the Accept
   button – if they say that this is the only code I need, can this be only one?
   how will I need to modify your code?
 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10710866)
 * Hi @magicpowers,
 * If needed we will assist you accordingly. JUst let us know.
 *  Thread Starter Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10712371)
 * Hi [@webtoffee](https://wordpress.org/support/users/webtoffee/)
 * thank you, much appreciate it!
 * I just thought of another solution to simplify this process, which in fact I 
   would prefer anyway.
 * Can I configure my plugin to say something like:
 * ” We collect visitor information via cookies to provide you with a customised
   experience. Please read our Privacy Policy for details. If you continue using
   this site we’ll understand that you agree with this Policy”.
    and the button 
   to click would be “I UNDERSTAND”.
 * This way, there is only one button and so only one code would be needed.
 * Is such a configuration possible?
 *  Thread Starter Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10712621)
 * Hi [@webtoffee](https://wordpress.org/support/users/webtoffee/)
 * I now have another problem.
 * When I first installed your GDPR Cookie Consent Plugin I **assumed** that it 
   will identify, collect and describe all the cookies on my website as required**
   automatically**. This was important to me as I’m not a developer and while I 
   have built my own website, my back-end knoweldge is limited.
 * Now I realised that I actually need to manually add all the cookies on my website
   to the plugin – which is disappointing.
 * The problem is that when I accessed the cookie list from the console, the names
   of most of them are non-recognisable to me. In other words, I can’t list the 
   title, deecription, and identify the type, duration and sensitivity of all these
   cookies. I don’t have a clue which ones are necessary and which are not. The 
   console field VALUE contains the data in various alpha-numeric forms not giving
   me a pattern.
 * Some of them also appear to be wp admin cookies which would not be applicable
   to the visitors, even though I logged off from my WP site before checking the
   cookies.
 * So the bottom line is that I’m unable to list my cookines with all those required
   details without help.
 * Do you know of a plugin that would identify and analyse the website cookies providing
   the required information? if not, unfortunately, I will need to find another 
   cookie consent plugin that will do this job for me.
 * please advise.
 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10712666)
 * Hi @magicpowers,
 * The [premium version](https://www.webtoffee.com/product/gdpr-cookie-consent/)
   of the GDPR Cookie Consent plugin has the feature to automatically scan the cookies
   that are being used by your website and add them to the plugin. The plugin also
   populates the fields of the cookie page automatically including the cookie ID
   and duration of the cookies and the rest of the details with default values which
   you can edit later at any time.
 * And the plugin also allows you to automatically block the scripts of Google Analytics,
   Facebook Pixel, and Google Tag Manager until the user gives their consent or 
   reject the cookies.
 *  Thread Starter Anonymous User
 * (@anonymized-15351932)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10712683)
 * I didn’t pick up this difference when installing your plugin. I don’t think this
   information what the free version is lacking is there.
 * The automatic scan and listing of the cookies is the most critical function of
   the cookie consent plugin – without it the plugin has little value.
 * I’m not planning to pay for a cookie plugin – however will consider my options.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Inserting a code’ is closed to new replies.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

## Tags

 * [Custom Coding](https://wordpress.org/support/topic-tag/custom-coding/)
 * [gdpr plugin](https://wordpress.org/support/topic-tag/gdpr-plugin/)

 * 9 replies
 * 2 participants
 * Last reply from: Anonymous User
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-a-code/#post-10712683)
 * Status: resolved