The Great Wall served as a highway only for the military. Soldiers could mobilise on it and go wherever urgencies emerged. As for civilians， they weren’t allowed to be on the Wall.
In the ancient time， most towns or villages close to the Wall were habited by soldiers and their families. The nomads outside the Wall would come and trade with these people at designated markets in the name of “tribute”. For example， Mongols would sell their horses to Chinese and buy salt， tea， silk cloth etc. in return.
The traders from inside the Wall had to get permits from the government to do the business with the nomads， otherwise they would be arrested for being too close to the border.
So the situation is clear. The Great Wall will restrict traders to certain places (normally large gates in the wall) where both sides could trade with each other. The nomads can only trade with certain people (those who have permits from the government).
Also， merchants from inside the Wall could go to other countries. They also had permits from the government， otherwise they were unable to pass through the Wall.
Finally， the government could tax the traders since everything was under control (permits， designated markets etc.) That’s one way ancient China could make some money.
There were several Great Walls. Each of them controlled trade， among other things.
Also helped North China by making raiding a lot harder. A man could scale an undepended portion of the wall， but getting a horse over would be much tougher. Likewise getting back if pursued.
Well， let’s just take Ming dynasty as an example.
The Ming Dynasty， despite of its initial offensives back in 14th century， suffered a severe loss in the battle of Tu Mubao (The Soil-Timber Fortress) in 1449 and therefore was forced to employ passive defense behind the Great Wall.
Although such strategies worked not that effectively in the military sense as the Mongolians continued their raid， the Ming Dynasty still suspended the trade by their nine gateways， thus cut off the essentials of Mongolians in the north largely， if not completely.
It turned out then the Mongolian chefs could hardly cook because the import of iron skillets was cut off. Thus the nomads commanded by Altan Khan rushed into the interior soil again. Eventually， a trade deal was made in which both sides decided to exchange Mongolian horses for Ming’s every-day products.
So all in all here， the Great Wall influenced the economy of Ancient China as a massive embodiment of tariff.
The great wall blocked most of the accessible border for trading， so the trading merchants can only do business through some open gates which is called 关. As a result， the trade was somehow controlled and can be eventually taxed， which was a great advantage against the northern nomads.
So it didn‘t serve as trade highway but more like filter.