Can I delete just the activities from a single Garmin device from my Garmin Connect account?

Former Member
Former Member

Before going on a cycling holiday, I uploaded the routes to mine and a friend's Garmin 820s.  He also asked for me to update his device, as he rarely attaches it to his PC.

Whilst I connected his 820 to my PC, it has sync'ed all his rides to my G-Connect account.  As we ride together a lot, there are some very similar rides and telling the 100s of activities apart is going to takes ages...

Is there a way of sorting the data by a unique identifier, such as device serial number, so I can remove all his activities from my account, without reading each one to compare start and finish locations?

Any assistance would be appreciated.

  • as the title said, how do i do it ?

    The answers in this thread did not help?

  • Thank you so much!!!

    Just a tip for the other non programmers like me: press Ctrl and enter after pasting the copied date in STEP 9, 10 and 11.

  • I'm trying this on Aug 22, 2025, MacOS 15.06 Chrome 139.0.7258.128 (Official Build) (arm64). The first script to get my device ID works fine, but the second script returns "undefined" after Fetching activity

    index__vendor__5.16.0.31.js:4 Fetching activity list (this might take a while)...
    undefined
    index__vendor__5.16.0.31.js:4 Showing matching activities:
    index__vendor__5.16.0.31.js:4 Finished showing activities.

  • The first script to get my device ID works fine, but the second script returns "undefined" after Fetching activity

    Sorry for the confusion but this is expected behaviour. For technical reasons, every javascript script has to return a value, and in this case, the 2nd script returns nothing ("undefined"). Due to the way the Chrome console works, it isn't possible to prevent it from displaying the return value.

    It is also expected behaviour that the 2nd script returns before actually fetching and showing/deleting activities - those steps are necessarily done in the background.

    Based on the rest of your output, it seems that the script thinks there are no activities matching the given device.

    So to be clear, you are passing the device id returned by the first script into the 2nd script?

    e.g. Say the first script has the following output:

    The device ID for this activity is: 12345678

    I assume you are running the 2nd script as follows:

    deleteGarminConnectActivities(12345678, "show")

    And you're running both scripts on the same account?

    As a sanity check (to make sure that the script isn't broken), if you've ever created any manual activities, their device ID will be 0. You should be able to show these activities as follows:

    deleteGarminConnectActivities(0, "show")

  • Yes, I'm running on the same account, in the same Chrome window, during the same session. I tried deleteGarminConnectActivities(0, "show") and it doesn't return anything either, but I don't know if I've ever manually created an Activity.

    I started checking other activity types, and I'm getting similar results:

    The device ID for this activity is: 1157808
    deleteGarminConnectActivities(1157808, "show")
    index__vendor__5.16.0.31.js:4 Fetching activity list (this might take a while)...
    undefined
    index__vendor__5.16.0.31.js:4 Showing matching activities:
    index__vendor__5.16.0.31.js:4 Finished showing activities.

     

  • Hey thanks for posting. Thanks to you, I found that certain old activities (or old devices) don't have the device ID in the activity list API response.

    I updated the 2nd script so that when the device ID is missing, it will try to retrieve the ID from the activity metadata API (same way it's done with the first script to get the device ID). This should work, but it means that the script will be a lot slower overall, as it will have to make an extra request for every activity which is missing the device ID. (In your case, it could be all of them.)

    The latest script will always be linked at the original answer: https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-web/165851/can-i-delete-just-the-activities-from-a-single-garmin-device-from-my-garmin-connect-account/901884#901884 

    I've also added options for showing activities for all devices. (the output will include the device ID)

    e.g.

    Show all activities (regardless of device):

    connectActivities("show")

    Show last 10 activities (regardless of device)

    connectActivities("show", { limit: 10 })

    You can see all options as follows:

    connectActivities()

    I will also say I am very aware it's not a great user experience listing / deleting what could be 100s or 1000s of activities in the browser console. I do think it's easier to run a script in the browser than it would be to install a python script with all the necessary dependencies. Garmin modernized their authentication a few years ago, which broke all the old python scripts that talk to Connect. Now most python scripts that talk to Connect use a 3rd-party library to handle authentication, which means you can't just download a single script file and run it anymore. You have to install a library, which makes things more complicated.

  • I updated the browser script to add date filtering. Here's some examples:

    - Show script options:

    connectActivities()

    - Show all activities (with device ID):

    connectActivities("show")

    - Show last 10 activities (and display device ID):

    connectActivities("show", { limit: 10 })

    (the limit is applied before device/date filtering. specifying a relatively small limit can make the script run a lot faster if you have years of activities, but it also means you might miss out on activities you need to delete)

    - Show all activities for 2025-03-31 (March 31, 2025):

    connectActivities("show", { at: "2025-03-31" })

    - Show all activities for March 2025:

    connectActivities("show", { startingAt: "2025-03-01", endingAt: "2025-03-31" })

    - Show activities for device ID 1234, for March 2025:

    connectActivities("show", { device: 1234, startingAt: "2025-03-01", endingAt: "2025-03-31" })

    - Delete activities for device ID 1234, for March 2025:

    connectActivities("delete", { device: 1234, startingAt: "2025-03-01", endingAt: "2025-03-31" })

    - Delete activities for device ID 1234, after [but not including] 2025-03-31:

    connectActivities("delete", { device: 1234, after: "2025-03-31" })

    - Delete activities for device ID 1234, before [but not including] 2025-03-31:

    connectActivities("delete", { device: 1234, before: "2025-03-31" }) 

    - Delete activities for device ID 1234, starting with [and including] 2025-03-31:

    connectActivities("delete", { device: 1234, startingAt: "2025-03-31" })

    - Delete activities for device ID 1234, ending at [and including] 2025-03-31:

    connectActivities("delete", { device: 1234, endingAt: "2025-03-31" })

    --

    Date filters:

    - Dates are specified as "YYYY-MM-DD" (e.g. "2025-03-31" means March 31, 2025)

    - Use the at option to show or delete activities on a single day

    - The other date filter options (before, after, startingAt, endingAt) can be combined in any way that makes sense. The only combos that aren't allowed are:

    - before and endingAt

    - after and startingAt

    --

    Couple of screenshots (click to enlarge):

    --

    Note to mods/Garmin:

    I know Garmin [*] absolutely does not care about these forums and probably wouldn't be able to fix them in any case but I spent a bunch of time trying to add the above information to the accepted answer, but ofc the forum wouldn't let me.

    Very frustrating to have to fight the platform like this, while we perform free labour for Garmin. (That's the only reason the forums exist - so suckers volunteers can do unpaid work to ease the load on Garmin Support.)

    [*] I mean garmin the org, not any one individual