David Goldberg, the SurveyMonkey CEO who also was Facebook executive Sheryl Sandberg's husband, was exercising at a gym in a Mexican resort when he collapsed before he died Friday, a person close to the family said.

The person asked not to identified because they weren't authorized to speak publicly.

Efforts to revive Goldberg, who was vacationing with family and friends, were unsuccessful.

The family is planning a service in Silicon Valley on Tuesday. It is by invitation only and closed to the press.

Goldberg died of severe head trauma in an accident while exercising at a resort in the Mexican town of Punta Mita, a Mexican state official said Monday. He was found lying next to a treadmill Friday at the Four Seasons Resort Punta Mita, near Puerto Vallarta.

The popular Silicon Valley executive died Friday night at age 47. His company and family members confirmed his death Saturday but they did not give a cause of death, leading to widespread speculation.

Goldberg left his room at about 4 p.m. to exercise, and family members went to look for him after he didn't return, the Mexican official said. He was found at about 6:30 p.m. in one of the resort's gymnasiums lying by a treadmill in a pool of blood, with a blow to the lower back of his head.

He apparently had slipped on the treadmill and hit the machine, said the official, who was not authorized to speak to the press and spoke on condition of anonymity.

Goldberg still had vital signs when he was discovered, but later died at a hospital in Nuevo Vallarta, the official said. The cause of death was severe head trauma and hypovolemic shock, or bleeding, the official said.

The family had checked in on April 30 to the exclusive resort, where rooms start at $500 a night and villas go for up to $5,000 a night. The thatched roof resort nestled into a hillside overlooking the Pacific Ocean has an ocean-side infinity pool, golf course and rooms with hammocks and terraces opening out to the water.

In an interview last month, Goldberg told the news site Business Insider of maxing out his credit cards in the early 1990s to fund one of his first Internet ventures, a music site, before going on to work at other tech companies, including Yahoo.

In 2004, Goldberg married Sandberg, another longtime tech executive who now serves as chief operating officer of Facebook Inc.

Sandberg launched an international conversation about the dearth of women in positions of power with her 2011 book "Lean In: Women, Work and the Will to Lead." In it, Sandberg wrote of the adjustments she and her husband had to make to manage two high-profile careers while raising two children.

On Monday, the Walt Disney Co. moved up its earnings release to Tuesday morning to allow executives to attend Goldberg's funeral. Sandberg is a member of Disney's board of directors. The earnings report was originally scheduled for the afternoon following the stock market close.