Xuanzang left the Tang capital of Chang'an in 629 CE in open defiance of an imperial ban on foreign travel, beginning a journey that would take him across Central Asia to India and keep him away for sixteen years. He studied for an extended period at Nalanda, the great Buddhist monastic university, before returning to Chang'an in 645 with several hundred Buddhist manuscripts, relics and images, a haul substantial enough that the same emperor who had forbidden his departure received him publicly and with honor rather than punishing the breach.
The Great Wild Goose Pagoda was raised soon afterward, in 652, specifically to house what Xuanzang had brought back, part of the Da Ci'en Temple complex built under his patronage as a center for the translation work that would occupy the rest of his life. Xuanzang and his translation bureau rendered a large portion of the Indian Buddhist canon into Chinese from the texts stored there, shaping the doctrinal vocabulary of Chinese Buddhism for centuries.
The pagoda standing today is not quite the one built in 652. The original five story brick structure suffered damage over the following decades, and Empress Wu Zetian ordered it rebuilt in 704 CE at a taller seven story scale, the form that has survived into the present. Its plain, tapering brick profile has made it one of the most recognizable silhouettes in Xi'an.
The pagoda's name has nothing to do with its construction. A legend recorded well after completion tells of a flock of wild geese, one of which fell dead near the site, an event later writers connected loosely to self sacrifice, but the story postdates the pagoda by generations. In 2014 the pagoda was inscribed as part of the Silk Roads: the Routes Network of Chang'an-Tianshan Corridor UNESCO World Heritage Site.