Thinking long term, tech is always going to be a solid bet. What's more likely in the future? That more, or less, technology will be present in our lives? That a greater, or fewer, number of things in the future will have software integrated into them? And so on.
Advertising is a small part of "tech".
Well, yeah, but so are cars, groceries, weapons, etc etc. The question is - does tech justify the valuation it has right now, based on the potential for future earnings, or would that money be better off somewhere else. For the last few years with interest rates close to zero the cost of money in the future was low, making the possibility of future profits worth paying a premium for.
NOW with higher interest rates meaning future money is more expensive, those future profits look rather less appealing.