I fix this problem by add another "Clear Variable" before "set variable" in "Consent Cookie" Rule. I don't understand why it matters but it works. The click event in "Consent Cookie" rule will refresh the page. It seems that refresh page will erase clear variable? Can someone explain this?