This paper develops an advertising model in which goodwill affected by advertising effort has a positive effect on reference price and market demand. In a finite planning horizon, the optimal advertising strategy is provided by solving the optimization problem on the basis of Pontryagin's maximum principle, then the optimal sales price is obtained through one time pricing strategy. Furthermore, we extend this problem to an infinite planning horizon and present the corresponding optimal strategies. In addition, the relationships between system parameters and optimal solutions are analyzed. Numerical examples are employed to illustrate the effectiveness of the theoretical results, and to assess the sensitivity analysis of system parameters on the optimal strategies.