Cookies & the cookie consent widget
ShopWired's cookie consent widget enables you to add a cookie consent popup notification to your website to allow visitors to grant your website permission to place on their browser.
When you enable the cookie consent widget, the visitor will have to specifically grant permission to accept cookies from your website. You can select which cookies are placed only once the visitor has granted permission, and which can be placed without permission.
When the visitor selects the "I accept" option on the consent widget, the website page will be reloaded and the relevant cookies placed on their browser.
Configuring the cookie consent widget
Configuring the cookie consent widget
To enable the widget and configure its settings, navigate to Website settings > Cookie widget.
In the Cookie consent widget section, you can choose which tracking scripts you've entered into your ShopWired account require cookie consent before being placed on the visitor's browser.
Select the tracking script fields from the setting labelled Require cookie consent before setting the following scripts.
The contents of the visitor tracking field
This setting relates to visitor tracking scripts (e.g. Google Analytics) that you have configured.
The contents of the conversion code
This setting relates to conversion code scripts (e.g. for Google Adwords) that you have configured.
The contents of the live chat script
This setting relates to any scripts you have entered into the live chat script field.
The Google Analytics Tag
This setting relates to ShopWired's built-in Google Analytics 4 feature.
The Facebook Tracking Pixel
This setting relates to the Facebook Tracking Pixel feature.
Disqus
This setting relates to the Disqus blog comments feature.
Privacy policy website page path
The cookie consent widget contains a link for visitors to read your website's privacy policy (the link opens in a new window). You can enter the of your privacy policy into the Privacy policy website page path setting, usually this will be /privacy-policy
.
Google Consent Mode V2
Google Consent Mode V2
If you are using Google Analytics 4 (GA4) and want to implement Google Consent Mode V2 on your website, ShopWired strongly recommends:
- Using ShopWired's built-in Google Analytics 4 feature to configure GA4 on your website
- Activating the cookie widget to require cookie consent before GA4 is run on your website, by activating the The Google Analytics Tag setting
- Activating Google Consent Mode V2 on the Visitor monitoring page
For more information, read ShopWired's guidance on Google Consent Mode V2.
ShopWired's cookies
ShopWired's cookies
The ShopWired platform sets a number of cookies on visitors' browsers to provide the services of an ecommerce website. These cookies do not process personally identifiable information (including IP addresses) and therefore do not require the visitor's consent, including ShopWired's visitor statistics feature.
Cookie name | Description | Expiration time |
---|---|---|
amazon_Login_accessToken |
Used by and contains the access token | The expiration time varies |
basket |
Used by ShopWired’s shopping basket system and contains the basket token | Expires after 30 days |
login_token |
Used by the ‘remember me’ feature for website customer accounts and contains the login token | Expires after 7 days |
rated_questions |
Used by the product questions & answers feature and contains question IDs | Expires after 1 year |
wishlist |
Used by the wishlist system and contains product IDs | Expires after 400 days |
referrer |
Used by the referrer system | Expires after 60 days |
customer_referrer |
Used by the referral system | The expiration time is customisable within the app |
recently_viewed_products |
Stores the IDs of | Expires after 30 days |
_shopwired_theme_preview |
Used by the theme preview system when viewing a draft theme | Expires when the browser is closed |
__holding_page_token |
Used by the holding page feature | Expires after 24 hours |
_shopwired_visit |
Used by the visitor statistics feature on ShopWired to record a visit to your website, used in conjunction with _shopwired_visitor which tracks a visitor as they navigate across your website's pages |
Both expire after 30 days |
PHPSESSID is used to set the visitor’s |
Expires when the browser is closed |
Cookie consent Twig variable
Cookie consent Twig variable
A Twig variable is available to use on theme files, global.cookie_consent
, that will return true
if the visitor has granted permission for cookies to be placed on their browser.
You can use this variable to cover the placement of any tracking scripts that you have added directly to your theme files, e.g.
{% if global.cookie_consent %}
... (tracking scripts)
{% endif %}
Design of the cookie consent widget
Design of the cookie consent widget
The cookie consent widget has a fixed design that cannot be customised through your ShopWired account. To adjust the design of the consent widget, create a file in your website's theme files (in the views/partials
folder) named cookie_consent_widget.twig
.
Copy the code shown below into the file.
{% extends 'shopwired/cookie_consent_widget.twig' %}
{% set position = 'right' %}
{% set text_color = 'white' %}
{% set button_text_color = 'black' %}
{% set button_background_color = '#eed547' %}
{% set button_text = 'I accept' %}
{% block text %}
This website uses cookies to ensure you get the best experience on our website.<br>
Read our <a href="{{ privacy_policy_link|default('/privacy-policy') }}" style="color: inherit; text-decoration: underline;">Privacy Policy</a>
{% endblock %}
The position
value should be set as either left
or right
and determines on which side of the browser the widget is displayed.
The text_color
value sets the colour of the text. Use a here, e.g. #ff0000 (for red) or an .
The button_text_color
and button_background_color
values set the colours of the button text and background for the "I accept" button and also use hexadecimal colour references or HTML color names.
The button_text
value sets the text within the button.
Finally, the text contained within the {% block text %}...{% endblock %} code sets the text that appears within the widget.
Advanced customisations to the cookie consent widget
Advanced customisations to the cookie consent widget
Using the advanced customisation method you can change the appearance of the cookie widget to your exact requirements, to do so create a file in your website's theme files (in the views/partials
folder) named cookie_consent_widget.twig
.
Some example code (which is the code used to generate the default cookie consent widget) is shown below:
{% block html %}
<div id="__shopwired_cookie_consent_container" style="{{ position == 'left' ? 'left' : 'right' }}: 20px; bottom: 20px; position: fixed; background-color: rgba(0, 0, 0, 0.8); padding: 15px 20px 20px; width: 320px; z-index: 9999; box-sizing: border-box; -webkit-backface-visibility: hidden; display: none;">
<div id="__shopwired_cookie_consent_close" style="position: absolute; right: 6px; top: 4px; font-family: Arial, sans-serif; font-size: 17px; font-weight: normal; font-style: normal; line-height: 1; color: #fff; cursor: pointer;">X</div>
<div style="color: {{ text_color|default('#fff') }}; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: normal; font-style: normal; line-height: 1.35; margin-bottom: 15px;">
{% block text %}
This website uses cookies to ensure that you get the best experience on our website. Read our
<a href="{{ privacy_policy_link|default('/privacy-policy') }}" style="color: inherit; text-decoration: underline;">privacy policy</a>.
{% endblock %}
</div>
<div id="__shopwired_cookie_consent_accept" style="background: {{ button_background_color|default('#eed547') }}; color: {{ button_text_color|default('#000') }}; width: 190px; height: 36px; line-height: 36px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: normal; font-style: normal; text-align: center; cursor: pointer;">
{{ button_text|default('I accept') }}
</div>
</div>
{% endblock %}
{% block script %}
<script>
(function(window, document) {
var declineCookieName = '__cookie_consent_declined',
container = document.getElementById('__shopwired_cookie_consent_container');
if (!container) {
return;
}
document.body.appendChild(container);
if (!decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(declineCookieName).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1"))) {
container.style.display = 'block';
}
var acceptButton = document.getElementById('__shopwired_cookie_consent_accept');
if (acceptButton) {
acceptButton.addEventListener('click', function() {
var date = new Date();
date.setTime(date.getTime() + (30 * 24 * 3600 * 1000));
document.cookie = '__cookie_consent=1; expires=' + date.toUTCString() + '; path=/';
container.outerHTML = '';
window.location.reload();
});
}
var closeButton = document.getElementById('__shopwired_cookie_consent_close');
if (closeButton) {
closeButton.addEventListener('click', function() {
document.cookie = declineCookieName + '=1; path=/';
container.outerHTML = '';
});
}
})(window, document);
</script>
{% endblock %}