This paper studies a revenue and social welfare optimization problem for an online service system which provides service-free trials to first-time users. There are two customer types: experienced customers and first-time customers, where type-1 (experienced) customers are fully rational, and they directly purchase service upon arrivals, while type-2 (first-time) customers are boundedly rational, so they may consider to purchase service or not to purchase service after experiencing the free trials. We investigate the optimal pricing strategy of service providers and social planners in two cases: service capacity is exogenous and endogenous. In the latter case, we jointly determine the optimal service price and capacity. We adopt a game theoretical approach: First, for a given price and service rate, we characterize the equilibrium behavior of post-trial customers; next, we solve optimization problems for the service provider and social planners to determine the optimal price and service rate. Our analysis reveals interesting insights and practical implications. For example, in contrast to the conventional wisdom, the service provider's optimal revenue decreases as customers become less rational.