Thanks Mark and good afternoon everyone. Let's begin with our consolidated results. All comparisons are on a year-over-year basis unless otherwise noted. Q2 total revenue was $39.1 billion up 22% or 23% on a constant currency basis. Q2 total expenses were $24.2 billion, up 7% compared to last year. In terms of the specific line items, cost of revenue increased 23% driven primarily by higher infrastructure and reality labs inventory costs. R&D increased 13%, primarily driven by higher headcount-related expenses and infrastructure costs which were partially offset by lower restructuring costs. Marketing and sales decreased 14%, due mainly to lower restructuring and headcount-related costs. G&A decreased 12%, mostly due to lower legal-related expenses.
We ended the first quarter with almost 70,800 employees, up 2% from Q1. Second quarter operating income was $14.8 billion, representing a 38% operating margin. Our tax rate for the quarter was 11%. Net income was $13.5 billion, or $5.16 per share. Capital expenditures, including principal payments on finance leases, were $8.5 billion, driven by investments in servers, data centers, and network infrastructure. Free cash flow was $10.9 billion. We repurchased $6.3 billion of our Class A common stock and paid $1.3 billion in dividends to shareholders, ending the quarter with $58.1 billion in cash and marketable securities and $18.4 billion in debt.
Moving now to our segment results. I'll begin with our Family of Apps segment. Our community across the Family of Apps continues to grow, with approximately 3.27 billion people using at least one of our Family of Apps on a daily basis in June. Q2 total Family of Apps revenue was $38.7 billion, up 22% year-over-year. Q2 Family of Apps ads revenue was $38.3 billion, up 22% or 23% on a constant currency basis.
Within ad revenue, the online commerce vertical was the largest contributor to year-over-year growth, followed by gaming and entertainment and media. On a user geography basis, ad revenue growth was strongest in rest of world and Europe at 33% and 26% respectively. Asia Pacific grew 20% and North America grew 17%. On an advertiser geography basis, total revenue growth continued to be strongest in Asia Pacific at 28%. The growth was below the first quarter rate of 41%, as we lapped a period of stronger demand from China-based advertisers. In Q2, the total number of ad impressions served across our services and the average price per ad both increased 10%. Impression growth was mainly driven by Asia Pacific and rest of world. Pricing growth was driven by increased advertiser demand in part due to improved ad performance. This was partially offset by impression growth particularly from lower monetizing regions and surfaces.
Family of Apps other revenue was $389 million, up 73%, driven primarily by business messaging revenue growth from our WhatsApp business platform. We continue to direct the majority of our investments toward the development and operation of our Family of Apps. In Q2, Family of Apps expenses were $19.4 billion, representing approximately 80% of our overall expenses. Family of Apps expenses were up 4%, mostly due to higher infrastructure and headcount related expenses, which were partially offset by lower restructuring costs. Family of Apps operating income was $19.3 billion, representing a 50% operating margin.
Within our Reality Labs segment, Q2 was $353 million, up 28% driven primarily by Quest headset sales. Reality Labs expenses were $4.8 billion, up 21% year-over-year, driven mainly by higher headcount-related expenses and Reality Labs inventory costs. Reality Labs operating loss was $4.5 billion. Turning now to the business outlook.
There are two primary factors that drive our revenue performance, our ability to deliver engaging experiences for our community and our effectiveness at monetizing that engagement over time. To deliver engaging experiences, we remain focused on executing our priorities, including video and in-feed recommendations. On Instagram, Reels engagement continues to grow as we make ongoing enhancements to our recommendation systems. Part of this work has been focused on increasing the share of original posts within recommendations so people can discover the best of Instagram, including content from emerging creators. Now, more than half of recommendations in the US come from original posts.
On Facebook, we're seeing encouraging early results from the global rollout of our unified video player and ranking systems in June. This initiative allows us to bring all video types on Facebook into one viewing experience, which we expect will unlock additional growth opportunities for short-form video, as we increasingly mix shorter videos into the overall base of Facebook video engagement. We expect the relevance of video recommendations will continue to increase as we benefit from unifying video ranking across Facebook and integrating our next-generation recommendation systems. These have already shown promising gains since we began using the new systems to support Facebook Reels recommendations last year. We expect to expand these new systems to support more services beyond Facebook video over the course of this year and next year.
We are also seeing good momentum with our longer-term engagement priorities, including Generative AI and Threads. People have used Meta AI for billions of queries since we first introduced it. We're seeing particularly promising signs on WhatsApp in terms of retention and engagement, which has coincided with India becoming our largest market for Meta AI usage. You can now use Meta AI in over 20 countries and eight languages, and in the US we are rolling out new features like Imagine Edit, which allows people to edit images they generate with Meta AI. Beyond Generative AI, the Threads community also continues to grow and deepen their engagement, as we ship new features and enhance our content recommendation systems.
Now to the second driver of our revenue performance, increasing monetization efficiency. There are two parts to this work. The first is optimizing the level of ads within organic engagement. We continue to see opportunities to grow ad supply on lower monetizing surfaces like video, including within Facebook as the mix of overall video engagement shifts more to shorter videos over time, which creates more ad insertion opportunities. More broadly, we are continuing to get better at determining the best ads to show and when to show them during a person session across both Facebook and Instagram. This is enabling us to drive revenue growth and conversions without increasing the number of ads or in some cases even reducing ad load. The second part of improving monetization efficiency is enhancing marketing performance. We continue to be pleased with our progress here, with AI playing an increasingly central role. We're improving ad delivery by adopting more sophisticated modeling techniques made possible by AI advancements, including our Meta Lattice ad ranking architecture, which continued to provide ad performance and efficiency gains in the second quarter. We're also making it easier for advertisers to maximize ad performance and automate more of their campaign setup with our Advantage+ suite of solutions. We're seeing these tools continue to unlock performance gains, with a study conducted this year demonstrating 22% higher return on ad spend for US advertisers after they adopted Advantage+ Shopping campaigns. Advertiser adoption of these tools continues to expand and we are adding new capabilities to make them even more useful. For example, this quarter we introduced flexible format to Advantage+ Shopping, which allows advertisers to upload multiple images and videos in a single ad that we can select from and automatically determine which format to serve in order to yield the best performance. We have also now expanded the list of conversions that businesses can optimize for using Advantage+ shopping to include an additional 10 conversion types, including objectives like add to cart.
Looking forward, we believe Generative AI will play a growing role in how businesses market and engage with customers at scale. We expect this technology will continue to make it easier for businesses to develop customized and diverse ad creatives. We've seen promising early results since introducing our first Generative AI ad features, image expansion, background generation, and text generation with more than 1 million advertisers using at least one of these solutions in the past month. In May, we began rolling out full image generation capabilities into Advantage+ Creative, and we're already seeing improved performance from advertisers using the tool. Finally, we expect AI will help businesses communicate with customers more efficiently through messaging. We're starting by testing the ability for businesses to use AI in their chats with customers to help sell their goods and services and to generate leads. While we are in the early stages, we continue to expand the number of advertisers we are testing with and have seen good advances in the quality of responses since we began using Llama 3. Next, I'd like to discuss our approach to capital allocation which remains unchanged. We continue to invest both in enhancing our core experiences in the near-term and developing technologies that we believe will transform how people engage with our services in the years ahead. We expect that having sufficient compute capacity will be central to many of these opportunities.
So we're investing meaningfully in infrastructure to support our core AI work in content ranking and ads, as well as our generative AI and advanced research efforts. Our ongoing investment in core AI capacity is informed by the strong returns we've seen and expect to deliver in the future, as we advance the relevance of recommended content and ads on our platform. While we expect the returns from Generative AI to come in over a longer period of time, we're mapping these investments against the significant monetization opportunities that we expect to be unlocked across customized ad creative, business messaging, a leading AI assistant and organic content generation. As we scale generative AI training capacity to advance our foundation models, we'll continue to build our infrastructure in a way that provides us with flexibility in how we use it over time. This will allow us to direct training capacity to gen AI inference or to our core ranking and recommendation work, when we expect that doing so would be more valuable. We will also continue our focus on improving the cost efficiency of our workloads over time. Reality Labs remains our other long-term initiative that we continue to invest meaningfully in.
Quest 3 is selling well and Ray-Ban Meta smart glasses are showing very promising traction with the early signals that we're seeing across demand, usage and retention increasing our confidence in the long-run potential of AR glasses. Finally, as we pursue these investments across near and long-term priorities, we will remain focused on operating the business efficiently.
Turning now to the revenue outlook. We expect third quarter 2024 total revenue to be in the range of $38.5 billion to $41 billion. Our guidance assumes foreign currency is a 2% headwind to year-over-year total revenue growth based on current exchange rates. Turning now to the expense outlook. We expect full year 2024 total expenses to be in the range of $96 billion to $99 billion, unchanged from our prior outlook.
For Reality Labs, we continue to expect 2024 operating losses to increase meaningfully year-over-year due to our ongoing product development efforts and investments to scale our — to further scale our ecosystem. While we do not intend to provide any quantitative guidance for 2025 until the fourth quarter call, we expect infrastructure costs will be a significant driver of expense growth next year. As we recognize depreciation and operating costs associated with our expanded infrastructure footprint. Turning now to the CapEx outlook. We anticipate our full year 2024 capital expenditures will be in the range of $37 billion to $40 billion, updated from our prior range of $35 billion to $40 billion.
While we continue to refine our plans for next year, we currently expect significant CapEx growth in 2025 as we invest to support our AI research and our product development efforts. On to tax. Absent any changes to our tax landscape, we expect our full year 2024 tax rate to be in the mid-teens. In addition we continue to monitor an active regulatory landscape, including the increasing legal and regulatory headwinds in the EU and the US that could significantly impact our business and our financial results.
In closing, Q2 was another good quarter. We continue to execute well across our business priorities and have exciting opportunities in front of us to deliver more value to the people and businesses using our products around the world. With that, Krista let's open up the call for questions.