cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.

Strava not reconciling duplicate activities

Cyril
Shkhara

Users are complaining that their activities are duplicated/triplicated within Strava Apps, because they seem to increasingly use multiple recording devices (for example recording a Zwift ride with a Polar watch and Garmin bike computer, or recording the same run with a Garmin watch and the Strava app).

I could try and reconcile these duplicate activities within my own app but it really is a Strava issue, as your stats and API activities will also be unnecessarily duplicated.

Maybe some API users really need to know which device created the activity, but I imagine that 99% of the time they just need to know that one single activity took place, and that its properties can be processed.

Is Strava thinking about handling this issue soonish or should I look at implementing my own fix?

7 REPLIES 7

celvinpieterson
Mt. Kenya

Handling duplicate activities recorded by multiple devices is a common issue faced by Strava users. While Strava has been aware of this issue, they have not yet implemented a built-in solution to automatically reconcile duplicate activities. This means that, as an app developer, you may need to implement your own fix to manage these duplicates.

Possible Solutions for Handling Duplicate Activities

  1. Identify Duplicate Activities:

    • Use the Strava API to fetch activity data.
    • Compare activities based on start time, duration, distance, and GPS data.
    • Identify duplicates based on these similarities.
    • Merge or Discard Duplicates:

      • Once duplicates are identified, decide whether to merge them or discard the redundant ones.
      • Merging might involve combining data from multiple sources to create a single, more accurate record.
      • Store Device Information:

        • Keep track of the device that recorded each activity.
        • Use this information to decide which device's data to prioritize in case of duplicates.
        • User Preferences:

          • Allow users to set preferences for handling duplicates.
          • Users can choose which device to prioritize or if they want automatic reconciliation.

            Implementation Steps

            Here’s a basic outline of how you might implement this in your app:

            1. Fetch Activities from Strava API:
              import requests def fetch_activities(access_token): url = "https://www.strava.com/api/v3/athlete/activities" headers = {"Authorization": f"Bearer {access_token}"} response = requests.get(url, headers=headers) activities = response.json() return activitiesIdentify Duplicates:

              def find_duplicates(activities): duplicates = [] for i in range(len(activities)): for j in range(i + 1, len(activities)): if is_duplicate(activities[i], activities[j]): duplicates.append((activities[i], activities[j])) return duplicates def is_duplicate(activity1, activity2): start_time1 = activity1['start_date'] start_time2 = activity2['start_date'] duration1 = activity1['elapsed_time'] duration2 = activity2['elapsed_time'] distance1 = activity1['distance'] distance2 = activity2['distance'] # Check if activities start at the same time, have similar duration and distance if (start_time1 == start_time2 and abs(duration1 - duration2) < 60 and abs(distance1 - distance2) < 100): return True return False 

            2.  Handle Duplicates

              def handle_duplicates(duplicates): for activity1, activity2 in duplicates: # Decide which activity to keep based on user preferences or other criteria # For now, just print duplicates print(f"Duplicate found: {activity1['id']} and {activity2['id']}") activities = fetch_activities("your_access_token") duplicates = find_duplicates(activities) handle_duplicates(duplicates) 

            3. User Interface for Preferences:
                • Provide a user interface where users can set preferences for handling duplicates.
                • Save these preferences and use them in your duplicate handling logic.

                  By implementing these steps, you can manage duplicate activities within your app. This approach provides a temporary solution while waiting for Strava to potentially address the issue natively.

                  Celvin Pieterson - Automation Expert

 

 

 

 

newnton
Shkhara

Or if automatically doing it is too complex at least have a way to manually mark 2 workouts duplicate and add a tool to combine them.
This would be an easy feature, you could use a similar ui to the crop workouts feature for selecting timing, you can ask whether stats should be averaged across both, or taken from just one. This seems like a super simple feature which is absolutely on the Strava side to implement and I’m not sure how I fix my experience now aside from deleting a bunch of data from my Strava account and disconnecting some of my smart devices, which is ridiculous 

Guigui59
Mt. Kenya

04-11-2024 … Still nothing … Is it so hard to do ?? Got an Apple Watch for my pulse and a garmin edge for power … Apple find my duplicates picture and ask me regularly to erase them : it’s easy for them apparently 

DanStanciu
Mt. Kenya

If the time overlaps 98% or grater the activities could be auto reconciled. Also, users should have ability to manually reconcile or undo reconciliation, as needed.

Geof
Mt. Kenya

I know its not strava's fault but manufacturer are less and less keen to broadcast recorded data or pairing with HR sensors... see Bosch new smart system where no HR connectivity is available, no broadcast of internal powermeter... yet it happily integrates with strava.
Even if the community is actively requesting those changes, the answer is always the same "it's not foreseen on our roadmap"

Strava being the market leader and endpoint for such integrations, from a end-user perspective, it's the last resort to have it fixed once and for all.

Which one should be used ? The first one, and then merging only missing data into the first one (may it be GPS data, HR, powermeter, ...).

With which rule to detect duplicated activities? overlapping timestamps and their associated GPS datum within expected tolerances. If not create 2 differents activities...

Example : You record a 1 hour activity on device A (GPS, cadence, power) & device B (GPS, HR).
But you forgot to start recording on device B on the first 10 min. Device A stops recording after 50min as the battery dies...
You get home, it uploads device B activity... you charge-up device A then it uploads Device A activity...

1 char = 10min / A or B = data from device A or B / - = no_data
Activity A : AAAAA- (uploaded 2nd)
Activity B : -BBBBB (uploaded 1st)
Resulting activity  (source A or B)
GPS :       ABBBBB
power :    AAAAA-
Cad. :       AAAAA-
HR :         -BBBBB 
1 hour ride, the first 10 mins coming from device A, the last 50 mins coming from device B.
HR data not available for the first 10 min
Cadence & Power meter data not available for the last 10 min...

In short, develop/invest/buy a well known website (goto...) doing this without having to download & upolad tcx, and streamline it within your UI when duplicates are detected.

 

Jan_Mantau
Superuser
Superuser

If you state that this is a Strava issue then you should make some suggestions how Strava can solve this! With which rules should Strava detect that these are the same activities as they will be for sure have slightly different times, gps points and so on? Which of the multiple uploaded activities should Strava use in the end?

So the rules should be somthing along the lines of

if activity is similar, within time and space, then merge together with ranges.

similar acitivites denotes time, within 2-4%.
speed within 5%
Merge dataset from all sources (that is usable)