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

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.

Top Replies

All Replies

  • TL;DR Here's the python script: https://pastebin.com/WwsUauH1


    • Edited: July 6, 2023: Fixed 402 Payment Required error in device ID bookmarklet
    • Edited January 02, 2021: Fixed 402 Payment Required error in python script
    • Edited December 29, 2020: with new script and improved instructions


     okay, the good news is there is a way to do this. You will need a PC or Mac to do this. (Hypothetically it would be possible from your phone, but the UX would be terrible.)

    (The device ID should be a number - no letters or special characters)

    Get device ID (easy way)

    1a) As @2940134 pointed out, you can get the ID from the Settings > About menu on the watch.

    Get device ID (slightly harder)

    1.b.1) Visit https://pastebin.com/WiDzV0DD, click "raw" and copy all the text to your clipboard (CTRL/CMD-A, CTRL/CMD-C)

    1.b.2) Visit https://caiorss.github.io/bookmarklet-maker/ and paste (CTRL/CMD-V) the text from the previous step into the Code box. Change Title to something like "Garmin Device ID"

    1.b.3) Click Generate Bookmarklet

    1.b.4)

    Drag the blue "Garmin Device ID" button to your bookmarks toolbar

    OR

    (Firefox) Right-click on "Garmin Device ID" button and click Add Bookmark

    OR

    - Copy the text from the Output box

    - Bookmark/favorite any site at all

    - Edit the bookmark

    - Change the name of the bookmark to "Garmin Device ID"

    - Paste the text from Output into the address/URL box

    1.b.5) Open Garmin Connect: https://connect.garmin.com

    1.b.6) Navigate to an activity belonging to your friend's device

    1.b.7) Click on the "Garmin Device ID" bookmark. A window will pop up with the device ID of the activity (it will be a number): copy and paste this somewhere safe (like your Notes app, or Notepad)

    MAKE SURE YOU COPIED THE CORRECT DEVICE ID, AS THE NEXT STEP WILL DELETE ACTIVITIES PERMANENTLY.

    Delete Activities

    2) Get Python 3: https://www.python.org/downloads/

    3) Download the gc-deletebydevice.py script. Go here https://pastebin.com/WwsUauH1 and click "Download"

    4) Run the script:

    Windows: Double-click on the script

    or

    - Open command prompt

    - Type:
    cd %USERPROFILE%\downloads

    python3 gc-deletebydevice.py

    Mac: Open Finder, locate the script, right-click and select "Open With -> Python Launcher”

    or

    - Open the Terminal app

    - Type:

    cd ~/Downloads

    python3 gc-deletebydevice.py

    The script will prompt you for username, password, device ID, and date range. (You can leave the date range blank to delete all activities for the given device ID.)

  • Thanks for the reply WillNorthYork...

    I managed to do everything down to the last sentence...  When I run the script (on a Mac) three windows open, but none are asking for any details.  I have:

    WINDOW 1, CALLED:  "D***** --- -bash 80x24" window, which says:

    Last login: Mon Jun 24 16:52:09 on ttys000

    D*****-iMac:~ d*****$ 

    WINDOW 2, CALLED ""D***** --- pythonw ~/Downloads/gc-deletebydevice.py --- 80x24" window which says:

    Last login: Mon Jun 24 16:52:09 on ttys000

    cd '/Users/d*****/Downloads/' && '/usr/bin/pythonw'  '/Users/d*****/Downloads/gc-deletebydevice.py'  && echo Exit status: $? && exit 1

    D******-iMac:~ d*****$ cd '/Users/d******/Downloads/' && '/usr/bin/pythonw'  '/Users/d*****/Downloads/gc-deletebydevice.py'  && echo Exit status: $? && exit 1

    Traceback (most recent call last):

      File "/Users/d******/Downloads/gc-deletebydevice.py", line 41, in <module>

        import http.cookiejar

    ImportError: No module named http.cookiejar

    Press ENTER to exit.

    WINDOW 3 is the preferences for PythonW

    I cannot see anywhere to enter my details.  I only started using a Mac recently... Am I missing something?

    Thanks...  

  • Based on that error message in window 2, the script is being run with Python 2 instead of Python 3. Sorry about that.

    Try this instead.

    1) Open the Terminal app

    2) Type:

    cd ~/Downloads

    python3 gc-deletebydevice.py

  • Thanks! Worked like a charm.

    An easier way to query the device ID is to look in the "about" settings menu directly on the watch.

  •  Thanks for this code. I did something similar and synced a watch I had bought before I realized the previous owner had not cleared it. While it was great that it looked like I had run the NYC Marathon, it just wasn't so! :-)

    This worked perfectly to clear up the data.

  • Hi there, thanks so much for this - this fix is (almost) a godsend for me after making a massive syncing error and now I have years of my wife's data merged in my account. However when I run the script, I get this error at the end - any idea how to get around this please? 

    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>

  • I"m also trying to do this, but getting a lot of errors like this

    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open

        response = self._open(req, data)

     

    Please can you help?

  • I found the answer - you are my total superhero :) thank you so much! 

  • What is the answer? I get the same errors when trying to run the script to delete the files. Thank you!

  • For everyone who's encountering SSL / request.py errors, I uploaded a new version. Refer to original comment: forums.garmin.com/.../901884

    For those who are interested, the fix is this:

    # workaround for SSL certificate error
    
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
    

    stackoverflow.com/.../53310545