Good answers already, but there is a better way than a tax. Give an incentive for people to register in the census, no need to even tell them they're being counted. Some countries do it every few years.
They take some of the tax money and give a small payment to everyone. So my country is going to go door to door and give everyone 150 to help with school fees and uniforms soon out of kindness and love (school started a month ago, but it sounds great). So everyone is excited and not questioning any underlying motivations or what will be done with the records. Then probably in a short while we'll all have digital Id's they've been telling us we need.
About 5 years ago it was 50 each person for some other reason I don't recall.
The first strategy was to make it illegal not to vote, so everyone had to register their details or face a big fine, but that only got voting age people and 10's But obviously it's an excellent way of thousands especially in more remote villages couldn't afford to go into towngetting everyones details and register anywaylocation for govt use.