If I gain pips does my broker earn my total pips made?

Hi
Ok still new here, Spreads/Commission these are what brokers make right? If I start and up trend and gain 30 pips does my broker earning my total pips or just the spread between buy and sell?

spread only if there’s no commision.

So in other words they take a percentage of the total pips then?

That depends on the broker’s model.
DMA/STP brokers which offer core spreads profit from commisions only.
Some of them offer Marked-up spreads which means that they will include their commision into the spread which in turn can result in you seeing spreads like 3-5-10 pips (The most I’ve seen is 14).
Whereas with a Core spread broker will see the spreads as they come in from the broker’s liquidity pool. That kind of broker will charge the commision separately.
Market Makers/Dealing desk brokers can be all of the above because they have control over every aspect of your trading conditions. They can decide what the spread is, what’s the commision and execution speed along with what the slippage will be. So, yeah.
All depends on the type of broker and how they decided to work.