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?
The pageType:"errorPage" is working correctly however, pageName is also getting set. Whatever, I find my own approach. I choose a prop to record the page URL when it is a 404 page.
I found the problem: I created the Documentation under the wrong company. However the problem is that I do not have right to create one under the correct company.