Go to the Data Elements tab, then click the desired data element (or create a data element).
Set the Extension dropdown to Core, and the Data Element Type to Cookie.
Enter the cookie name in the text field.
The cookie value is stored in the data element. You can then reference the data element in rules to assign Analytics variables.
s.Util.cookieRead() in AppMeasurement and Launch custom code editor
method to read a desired cookie value. Its only argument is a string, which is required. This method returns a string containing the cookie value. If the cookies does not exist, an empty string is returned.
// Reads the value set in the cookie named 'example' and assigns the value to eVar1
s.eVar1 = s.Util.cookieRead("example");