Great write-up, thanks. One improvement I would make to help keep this as simple as possible is to be consistent with your variable names regarding Analytics type.
The class is name “Analytics”,
The reference is named “postMetrics”,
The Post’s internal name is “performance”.
Analytics, Metrics, Performance… in a real-world app it might be useful to use all these difference words because of the context of usage, but for the a simple tutorial like this I can see it just making it harder to follow.