Developer forum

Forum » Templates » Accept selected cookies in Swift

Accept selected cookies in Swift

Johan Lang
Johan Lang
Reply
Hi,
I need to know the command to the DW plattform to accept selected cookies in Swift because our customer uses another service for cookie management.
I have set up Swift default solution and use the template Cookies.cshtml.
 
The javascript functions run the following commands when pressing the button.
Accept All: CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=2
Decline all: CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=0
This is correct but for pressing the Accept selected button and just category Functional or Marketing or Statistical is marked, use: OptInLevel=0&OptInCategory=on&OptInCategory=on
and if two category is marked, for example Functional and Marketing, uses: OptInLevel=0&OptInCategory=on. There is nothing in the command which category or categories to be accepted. If no categories is marked and press accept selected button (see picture), use: OptInLevel=0&OptInCategory=on&OptInCategory=on&OptInCategory=on
 
So what is the correct command to the DW plattform for accept selected cookies?
Can I use for accept for example category Functional and  Statistical: OptInLevel=0&OptInCategory=on&OptInCategory=off&OptInCategory=on
and for example just accpect category Functional: OptInLevel=0&OptInCategory=on&OptInCategory=offOptInCategory=off?
Accept_selected_cookies.jpg

Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Johan,

There was an issue in Swift where the functionality for selecting specific cookie categories didn't work as expected. That issue has been fixed in latest version of Swift.
You can either download a new version of Swift or grab the updated cookie template from here:
https://github.com/dynamicweb/Swift/blob/main/Swift/Files/Templates/CookieWarning/Cookies.cshtml

The command for selecting specific cookie categories should look like this:

CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=1&OptInCategory=Functional,Statistical

or like this:

CookieOptInLevelConfig.aspx?cmd=SetCookieOptInLevel&OptInLevel=1&OptInCategory=Functional&OptInCategory=Statistical

... where you provide the names of the user selected cookie categories in the OptInCategory parameter.

Best regards,
Morten

Votes for this answer: 2
 
Johan Lang
Johan Lang
Reply

Hi Morten,

Ok, Thank you for the resonse

Best regards

Johan

 

You must be logged in to post in the forum