Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to set Target cookie with SECURE flag

Avatar

Employee Advisor

Hi,

I want to set a secure flag for my Target cookie and have tried the below method but it is not working. Could anybody share their thoughts on how to get it worked?

  • Added a custom code before 'Load Target' action is added in Launch rule.
  • Here is the script which is the part of above mentioned custom code -

window.targetGlobalSettings = {
secureOnly: true
}

The above mentioned method seems to be not working when I checked using chrome developer tools where I found empty value for the column SECURE.

We have also tried enabled:false to validate the above method which is working as expected as it is disabling the Target library.

Is there any other method to set this flag for Target? As for Adobe Analytics and ECID, this setting is present directly on editing the configurations for the respective extensions in Launch but for Target there is no direct way. 

Your timely help is well appreciated. 

Thanks in advance!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Khushboo_Kalia  Since secure flag can be set and available only on https pages, I hope you're trying on https pages?

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

@Khushboo_Kalia  Since secure flag can be set and available only on https pages, I hope you're trying on https pages?

Avatar

Community Advisor

@Khushboo_KaliaYou can try (if not already) adding window.targetGlobalSettings logic in at.js header in Target itself i.e. under Administration > Implementation > Edit at.js Settings > Code Settings > Library Header. There's a possibility that the value is getting overridden.

Avatar

Employee Advisor
@shelly-goel, thanks for getting back on this. Target implementation is done through Launch and I have tried setting other things through targetGlobalSettings within Launch rule which gives me expected results. On this particular issue, I have received the confirmation that setting the secure flag is not available in Target at present and will be considered as an enhancement to the tool.

Avatar

Employee

As a point of clarification, the targetGlobalSettings of secureOnly: true does not impact the Target set cookies (mbox, etc.) it forces all the requests made from at.js to always be over HTTPS (secure protocol). Noted here in help: https://experienceleague.adobe.com/docs/target/using/implement-target/client-side/functions-overview...