PepsiCo has managed to avoid a threatened boycott after it agreed to donate millions of dollars to non-profit youth organisations.