Only the part of the water pipe that is in the ground is the electrode. Code permits you to attach the grounding electrode conductor or bonding jumpers within the first 5' from the entrance so you don't have to dig up the pipe to make the connection, and perhaps administer additional treatment to prevent corrosion.

Note the exception permits connection at more than 5' in non-residential systems where only qualified persons service the installation. What that amounts to is, these sites are much less likely to replace a section of metal piping with plastic.