Before the ancient emperors went out to war, did they sacrifice to heaven or ancestors first?

Before the ancient emperors went to war, they offered sacrifices to their ancestors.

Sacrificing ancestors is a grand folk activity during the Spring Festival. Before the arrival of New Year's Eve, every household should provide genealogy, ancestor statues, memorial tablets, etc. In the hall at home, there are sacrificial tables, incense burners and offerings. While offering sacrifices to ancestors, some places also offer sacrifices to gods and land gods, and some places also offer sacrifices to the Jade Emperor (the highest god in Chinese folk beliefs) and the Queen Mother (the wife of the Jade Emperor). The offerings are sheep, five bowls of vegetables, five-color snacks, five bowls of rice, a pair of jujube cakes and a big bun, commonly known as "heaven and earth for". At the ceremony, parents light three incense sticks, bow down, pray for a bumper harvest, and finally burn paper, commonly known as "giving money to food". People worship their ancestors and gods during the Spring Festival, which is actually to pay a New Year call to ancestors and gods.