Even though you may have done the exact same route as your friend, each GPS device will record its own unique set of data. This GPS data will always be different because of the inherent variables involved in recording GPS data: recording interval (the time between GPS points), signal strength, GPS hardware, etc. The differences in the GPS data may cause differences in the calculated elevation data.
Another source of confusion is comparing elevation data from an activity with barometric data to that of an activity that has gone through our correction process. Both can be accurate ways of totaling elevation for GPS data, but the 'corrected' data is getting cross-referenced to the elevation basemap whereas the barometric elevation is being pulled from the data the barometric altimeter recorded into the file. Mobile recordings using our iPhone or Android app will always go through our correction process.
iPhone and Android devices do not have a barometric altimeter so if you're recording with the Strava mobile app your elevation has gone through the correction process. Some examples of devices with barometric altimeters are the Garmin Edge 1000, the Suunto Ambit2, the Wahoo Elemnt, and the Bryton Rider 310.
Why is my activity's elevation different from my other, similar activities?
In addition to inherent GPS variability, we changed our thresholds for elevation gain at the end of 2016 in an effort to provide more accurate elevation data to our athletes who record activities on devices which are not equipped with a barometric altimeter. For the vast majority, these changes have improved the quality of the elevation data reported on Strava. In some areas, the underlying elevation basemap data is poor resulting in inflated elevation totals on Strava.
Why is my activity's elevation on Strava different from my GPS device?
Because elevation data derived from a GPS signal is fairly inaccurate, Strava automatically corrects elevation derived from a GPS source by consulting elevation databases to determine the elevation at each point in the activity. Our thresholds and smoothing process may differ from that of the other platform or GPS device.
If you recorded your activity with a GPS device that has a barometric altimeter, but Strava isn't using that data, it's possible that device is not yet in our database or that the file you uploaded is missing a Device ID. You can confirm whether Strava has recognized your device's ID by looking for the name of your device on the activity details page on the web version of Strava (highlighted below)
We occasionally see this when activities get synced through 3rd parties so if you know the device is in our database, please try uploading the original file from the device.
Here is some more information on elevation for your activity