Shortcodes used in GDPR Cookie Consent Plugin

The Ultimate WordPress Plugin for EU Cookie Law (GDPR) Compliance

Used by 600,000+ WooCommerce Stores

#1 in Customer Satisfaction

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

The GDPR Cookie Consent plugin helps to create a cookie notification bar on a WordPress Website and take consent to the use of cookies. It also helps easily customize the components of the cookie bar. In addition to this, the plugin gives great flexibility with shortcodes for multiple purposes that can be used on any pages or posts on the website.

Below are all of the shortcodes used in the GDPR Cookie Consent plugin and what they are used for.

Cookie Bar Shortcodes

[cookie_accept]

This shortcode adds an Accept button that is already styled in green color and closes the header when clicked on. The shortcode can be used on the cookie notification bar to take the consent of the user.

Button using <a  class="cli_action_button cli-accept-button medium cli-plugin-button green" data-cli_action="accept" >ACCEPT</a> shortcode

[cookie_accept colour=blue] 

You can change the color of the Accept button from the set of pre-defined value for the colour attribute. You can choose from the colors red, blue, yellow, orange, green, or pink. Make sure to use the UK spelling of ‘colour’.

[cookie_button]

This shortcode adds the Accept button wherever it is applied from the backend of the website. Clicking on the button will register the consent for the usage of the cookies. The button added using this shortcode can be customized with the customization options given in the Accept section of the Customize Buttons tab or from the Themes tab on the Cookie Law Settings page.

Accept button

[cookie_settings] 

This is the cookie settings button rendering shortcode. The Settings button gives the users the granular control over the categories of cookies that they want to give consent to. When the user clicks on the Settings button, the user is shown a popup where they can select which cookie categories that they want to accept. 

Settings Button

[cookie_reject]  

This shortcode adds the Reject button that can be customized from the Cookie Law Settings page. The reject buttons thus added records the denial of the user to the use of any cookies by the website, when clicked upon.

Reject button using  <a  style="margin:5px 5px 5px 5px; border-radius:0; padding:8px 25px 8px 25px;" id="cookie_action_close_header_reject"  class="medium cli-plugin-button cli-plugin-main-button cookie_action_close_header_reject cli_action_button"  data-cli_action="reject">REJECT</a>

[cookie_link] 

This simple shortcode can be used to add the Read More link that can be linked to another URL or page on the website. This shortcode can be used to provide a link that can be redirected to the website’s privacy policy page. The URL or the page to which the shortcode links to is added from the Read More Link section under the Customize Buttons tab or from the Themes tab on the Cookie Law Settings page. The link can also be customized from the same page.

Read more link using <a href='https://www.webtoffee.com' id="CONSTANT_OPEN_URL" style="" target="_blank"  class="medium cli-plugin-button cli-plugin-main-link" >Read More</a>

[cookie_close]

This shortcode adds a Close button to the Cookie Notice bar. The close action will be treated as the user’s consent. The close button can be further customized from the Themes tab of the Cookie Law Settings page.

Other Shortcodes

[cookie_audit]

Since the website owner is required to inform the users of the cookies that are used in the website, this simple shortcode can be used to display all the cookies and its related details to be displayed in a tabular format wherever the shortcode is added. You can add the shortcode to your privacy policy page to inform the users of the cookies that are used on the website.

Cookie audit table
Audit table using
CookieTypeDurationDescription
_fbp02 monthsThis cookie is set by Facebook to deliver advertisement when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
_ga02 yearsThis cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, camapign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assigns a randoly generated number to identify unique visitors.
_gat_gtag01 minuteIdentification code of website for tracking visits.
_gh_sess1This cookie is used to preserve users states across page requests.
_gid01 dayThis cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form.
_hjid011 monthsHotjar cookie. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.
_hjIncludedInSample0This cookie is set to let Hotjar know whether that visitor is included in the sample which is used to generate Heatmaps, Funnels, Recordings, etc.
fr12 monthsThe cookie is set by Facebook to show relevant advertisments to the users and measure and improve the advertisements. The cookie also tracks the behavior of the user across the web on sites that have Facebook pixel or Facebook social plugin.
has_recent_activity01 hourThis cookie is used to signal to the code repository website if the user has browsed other website resources during the current session.
PHPSESSID0This cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing user session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.
tk_ai04 yearsGathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience.
tk_lr011 monthsThis cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack
tk_or04 yearsThis cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack
tk_qs030 minutesGathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience.
tk_r3d03 daysThe cookie is installed by JetPack. Used for the internal metrics fo user activities to improve user experience
viewed_cookie_policy01 hourThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
shortcode
The shortcode takes the attributes style with values simple, classic, modern, rounded, elegant, winter. The table by default has the style classic. For example, the shortcode [cookie_audit style="winter"]  will add an audit table that looks as below.

Cookie audit table with style="winter"
Cookie audit table with style=”winter”

To display a message in the table if there are cookies to display, you can use the attribute not_shown_message. For example: [cookie_audit style="winter" not_shown_message="No cookies found"] 

Cookie audit table with no cookies found
Cookie audit table with no cookies found
[cookie_audit_category]

This shortcode is also used for displaying the cookies that have been added to the plugin in a tabular format but organized into categories. The table will list the cookies according to the categories that they belong to as defined by the user.

Cookie audit table with cookie category
Cookie audit table with cookie category
[cookie_audit category="categoryslug"]

This shortcode can be used to list out the cookie list in each category description. For example, if you want to list out the cookies under the analytics category, you may go and edit the Analytics category and insert [cookie_audit category="analytics"]  .

[cookie_popup_content]

This shortcode can be used to display the popup that appears when the Settings button is clicked, wherever the shortcode is applied.

Settings popup content using <div class="cli-container-fluid cli-tab-container">
    <div class="cli-row">
        <div class="cli-col-12 cli-align-items-stretch cli-px-0">
            <div class="cli-privacy-overview">
                                <h4>Privacy Overview</h4>
                                       
                <div class="cli-privacy-content">
                    <p><p>This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of the basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website, to store user preferences and provide you with content and advertisements that are relevant. Such cookies will be stored on your browser but only upon procuring consent.</p> <p>You will also have the option to opt-out of these cookies should you want to. But opting out of some of these cookies may have an effect on your browsing experience as per the descriptions elucidated against the respective categories below.</p></p>
                </div>
                <a class="cli-privacy-readmore" data-readmore-text="Show more" data-readless-text="Show less"></a>            </div>
        </div>  
        <div class="cli-col-12 cli-align-items-stretch cli-px-0 cli-tab-section-container">
            <div class="cli-tab-section cli-privacy-tab">
                <div class="cli-tab-header">
                    <a class="cli-nav-link cli-settings-mobile" >
                        Privacy Overview                    </a>
                </div>
                <div class="cli-tab-content">
                    <div class="cli-tab-pane cli-fade">
                        <p><p>This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of the basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website, to store user preferences and provide you with content and advertisements that are relevant. Such cookies will be stored on your browser but only upon procuring consent.</p> <p>You will also have the option to opt-out of these cookies should you want to. But opting out of some of these cookies may have an effect on your browsing experience as per the descriptions elucidated against the respective categories below.</p></p>
                    </div>
                </div>

            </div>
                            <div class="cli-tab-section">
                <div class="cli-tab-header">
                    <a class="cli-nav-link cli-settings-mobile" data-target="necessary" data-toggle="cli-toggle-tab" >
                        Necessary 
                    </a>
                                                    <span class="cli-necessary-caption">Always Enabled</span>                           
                                </div>
                <div class="cli-tab-content">
                    <div class="cli-tab-pane cli-fade" data-id="necessary">
                        <p>The cookies defines under this category are absolutely essential for the website to function. Hence they are loaded by default irrespective if user consent.</p>
<table class="cookielawinfo-row-cat-table cookielawinfo-winter"><thead><tr><th class="cookielawinfo-column-1">Cookie</th><th class="cookielawinfo-column-4">Description</th></tr></thead><tbody><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">PHPSESSID</td><td class="cookielawinfo-column-4">This cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing user session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">viewed_cookie_policy</td><td class="cookielawinfo-column-4">The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.</td></tr></tbody></table>
                    </div>
                </div>
                </div>
                            <div class="cli-tab-section">
                <div class="cli-tab-header">
                    <a class="cli-nav-link cli-settings-mobile" data-target="analytics" data-toggle="cli-toggle-tab" >
                        Analytics 
                    </a>
                                                <label class="cli-switch">
                    <input type="checkbox" class="cli-user-preference-checkbox" data-id="checkbox-analytics" checked  />
                    <span class="cli-slider" data-cli-enable="Enabled" data-cli-disable="Disabled"></span>                           
                </label>    
                                </div>
                <div class="cli-tab-content">
                    <div class="cli-tab-pane cli-fade" data-id="analytics">
                        <p>Analytics cookies help us understand how our visitors interact with the website. It helps us understand the number of visitors, where the visitors are coming from, and the pages they navigate. The cookies collect this data and are reported anonymously.</p>
<table class="cookielawinfo-row-cat-table cookielawinfo-winter"><thead><tr><th class="cookielawinfo-column-1">Cookie</th><th class="cookielawinfo-column-4">Description</th></tr></thead><tbody><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_ga</td><td class="cookielawinfo-column-4">This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, camapign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assigns a randoly generated number to identify unique visitors.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_gat_gtag</td><td class="cookielawinfo-column-4">Identification code of website for tracking visits.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_gid</td><td class="cookielawinfo-column-4">This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_hjid</td><td class="cookielawinfo-column-4">Hotjar cookie. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_hjIncludedInSample</td><td class="cookielawinfo-column-4">This cookie is set to let Hotjar know whether that visitor is included in the sample which is used to generate Heatmaps, Funnels, Recordings, etc.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">has_recent_activity</td><td class="cookielawinfo-column-4">This cookie is used to signal to the code repository website if the user has browsed other website resources during the current session.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">tk_ai</td><td class="cookielawinfo-column-4">Gathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience. </td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">tk_lr</td><td class="cookielawinfo-column-4">This cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">tk_or</td><td class="cookielawinfo-column-4">This cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">tk_qs</td><td class="cookielawinfo-column-4">Gathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience. </td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">tk_r3d</td><td class="cookielawinfo-column-4">The cookie is installed by JetPack. Used for the internal metrics fo user activities to improve user experience</td></tr></tbody></table>
                    </div>
                </div>
                </div>
                            <div class="cli-tab-section">
                <div class="cli-tab-header">
                    <a class="cli-nav-link cli-settings-mobile" data-target="advertisement" data-toggle="cli-toggle-tab" >
                        Advertisement 
                    </a>
                                                <label class="cli-switch">
                    <input type="checkbox" class="cli-user-preference-checkbox" data-id="checkbox-advertisement" checked  />
                    <span class="cli-slider" data-cli-enable="Enabled" data-cli-disable="Disabled"></span>                           
                </label>    
                                </div>
                <div class="cli-tab-content">
                    <div class="cli-tab-pane cli-fade" data-id="advertisement">
                        <p>Advertisement cookies help us provide our visitors with relevant ads and marketing campaigns. </p>
<table class="cookielawinfo-row-cat-table cookielawinfo-winter"><thead><tr><th class="cookielawinfo-column-1">Cookie</th><th class="cookielawinfo-column-4">Description</th></tr></thead><tbody><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_fbp</td><td class="cookielawinfo-column-4">This cookie is set by Facebook to deliver advertisement when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.</td></tr><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">fr</td><td class="cookielawinfo-column-4">The cookie is set by Facebook to show relevant advertisments to the users and measure and improve the advertisements. The cookie also tracks the behavior of the user across the web on sites that have Facebook pixel or Facebook social plugin.</td></tr></tbody></table>
                    </div>
                </div>
                </div>
                            <div class="cli-tab-section">
                <div class="cli-tab-header">
                    <a class="cli-nav-link cli-settings-mobile" data-target="preferences" data-toggle="cli-toggle-tab" >
                        Preferences 
                    </a>
                                                <label class="cli-switch">
                    <input type="checkbox" class="cli-user-preference-checkbox" data-id="checkbox-preferences" checked  />
                    <span class="cli-slider" data-cli-enable="Enabled" data-cli-disable="Disabled"></span>                           
                </label>    
                                </div>
                <div class="cli-tab-content">
                    <div class="cli-tab-pane cli-fade" data-id="preferences">
                        <p>Preference cookies are used to store user preferences to provide them with content that is customized accordingly. This includes the language of the website or the location of the visitor.</p>
<table class="cookielawinfo-row-cat-table cookielawinfo-winter"><thead><tr><th class="cookielawinfo-column-1">Cookie</th><th class="cookielawinfo-column-4">Description</th></tr></thead><tbody><tr class="cookielawinfo-row"><td class="cookielawinfo-column-1">_gh_sess</td><td class="cookielawinfo-column-4">This cookie is used to preserve users states across page requests.</td></tr></tbody></table>
                    </div>
                </div>
                </div>
                       
        </div>
        <div class="cli-col-12 cli-align-items-stretch cli-px-0">
            <div class="cli-tab-footer">
                                    <a class="cli_setting_save_button cli-btn">Save & Accept</a>
                            </div>
        </div>
    </div> 
</div>
Settings popup content using

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of the basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website, to store user preferences and provide you with content and advertisements that are relevant. Such cookies will be stored on your browser but only upon procuring consent.

You will also have the option to opt-out of these cookies should you want to. But opting out of some of these cookies may have an effect on your browsing experience as per the descriptions elucidated against the respective categories below.

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of the basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website, to store user preferences and provide you with content and advertisements that are relevant. Such cookies will be stored on your browser but only upon procuring consent.

You will also have the option to opt-out of these cookies should you want to. But opting out of some of these cookies may have an effect on your browsing experience as per the descriptions elucidated against the respective categories below.

Necessary Always Enabled

The cookies defines under this category are absolutely essential for the website to function. Hence they are loaded by default irrespective if user consent.

CookieDescription
PHPSESSIDThis cookie is native to PHP applications. The cookie is used to store and identify a users' unique session ID for the purpose of managing user session on the website. The cookie is a session cookies and is deleted when all the browser windows are closed.
viewed_cookie_policyThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Analytics cookies help us understand how our visitors interact with the website. It helps us understand the number of visitors, where the visitors are coming from, and the pages they navigate. The cookies collect this data and are reported anonymously.

CookieDescription
_gaThis cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, camapign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assigns a randoly generated number to identify unique visitors.
_gat_gtagIdentification code of website for tracking visits.
_gidThis cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the wbsite is doing. The data collected including the number visitors, the source where they have come from, and the pages viisted in an anonymous form.
_hjidHotjar cookie. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.
_hjIncludedInSampleThis cookie is set to let Hotjar know whether that visitor is included in the sample which is used to generate Heatmaps, Funnels, Recordings, etc.
has_recent_activityThis cookie is used to signal to the code repository website if the user has browsed other website resources during the current session.
tk_aiGathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience.
tk_lrThis cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack
tk_orThis cookie is set by JetPack plugin on sites using WooCommerce. This is a referral cookie used for analyzing referrer behavior for Jetpack
tk_qsGathers information for our own, first party analytics tool about how our services are used. A collection of internal metrics for user activity, used to improve user experience.
tk_r3dThe cookie is installed by JetPack. Used for the internal metrics fo user activities to improve user experience

Advertisement cookies help us provide our visitors with relevant ads and marketing campaigns.

CookieDescription
_fbpThis cookie is set by Facebook to deliver advertisement when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
frThe cookie is set by Facebook to show relevant advertisments to the users and measure and improve the advertisements. The cookie also tracks the behavior of the user across the web on sites that have Facebook pixel or Facebook social plugin.

Preference cookies are used to store user preferences to provide them with content that is customized accordingly. This includes the language of the website or the location of the visitor.

CookieDescription
_gh_sessThis cookie is used to preserve users states across page requests.
[delete_cookies]  or [delete_cookies text="Click here to delete"] 

This shortcode adds a link that when clicked upon deletes all the cookies that are specified in the plugin as a non-necessary cookie.

Delete cookies link using <a class='cookielawinfo-cookie-delete'>Delete Cookies</a> shortcode

when the attribute text is used with the shortcode Delete Cookies the link looks as shown below:

Cookie delete link with text="click here to delete"

[cookie_after_accept]Your Content goes here... [/cookie_after_accept]

Any content that is added in between these enclosing shortcodes will only be displayed if the cookie has been accepted. So this shortcode can be used to restrict any content to the users if they have not accepted the cookies.

[cookie_after_accept category=category1-slug]Your content goes here [/cookie_after_accept]

The category attribute of the shortcode allows restricting the content enclosed based on the category of the cookies specified. More than one categories can be specified and the content will be visible if all the categories of the cookies are enabled. For example, if you specify two categories in the “category” attribute of the shortcode, say Analytics and Marketing, if the user disables the cookies in the Analytics category, the content inside the shortcode will not be made available to the users. It is only when both the categories are enabled, that the users are able to access the content.

[cookie_after_accept category=category1-slug, category2-slug condition=or]Your content goes here [/cookie_after_accept] 

The attribute condition with value “or” allows you to display the content specified with the shortcode to be displayed in any of the categories mentioned are enabled. For example, if for there are two categories mentioned in the category attribute Analytics and Marketing, and the user enables any of the categories, the content inside the enclosing shortcodes will be made available to the users.

The Ultimate WordPress Plugin for EU Cookie Law (GDPR) Compliance

Used by 600,000+ WooCommerce Stores

#1 in Customer Satisfaction

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

4 thoughts on “Shortcodes used in GDPR Cookie Consent Plugin

    • Mark
      Mark says:

      Hi,

      We are sorry about the inconvenience. However, we can confirm that we haven’t made any recent changes in the styling that would affect the shortcode functionality.

      Please submit a ticket in the above support link with your site details so that we can have a deeper look.

    • Mark
      Mark says:

      Hi,

      The above article talks about 2 short codes ie [cookie_audit] and [cookie_audit_category]. One will display the full list of cookies and other lists the cookies category wise. You can use them in the privacy overview content.

      Read above for more info.

Leave a Reply

Your email address will not be published. Required fields are marked *