{"id":18388058,"url":"https://github.com/methodgrab/ga-clean-urls","last_synced_at":"2025-04-07T01:33:09.039Z","repository":{"id":10781934,"uuid":"66959991","full_name":"MethodGrab/ga-clean-urls","owner":"MethodGrab","description":"A plugin for Google Analytics to remove UTM query strings from URLs","archived":false,"fork":false,"pushed_at":"2022-03-26T16:23:37.000Z","size":103,"stargazers_count":2,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T10:24:07.361Z","etag":null,"topics":["google-analytics","google-analytics-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MethodGrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-30T16:51:09.000Z","updated_at":"2020-10-22T15:39:17.000Z","dependencies_parsed_at":"2022-08-07T06:00:33.438Z","dependency_job_id":null,"html_url":"https://github.com/MethodGrab/ga-clean-urls","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fga-clean-urls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fga-clean-urls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fga-clean-urls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MethodGrab%2Fga-clean-urls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MethodGrab","download_url":"https://codeload.github.com/MethodGrab/ga-clean-urls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578414,"owners_count":20961263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-analytics","google-analytics-plugin"],"created_at":"2024-11-06T01:30:35.700Z","updated_at":"2025-04-07T01:33:04.029Z","avatar_url":"https://github.com/MethodGrab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Analytics Plugin: Clean URLs [![Build Status](https://travis-ci.org/MethodGrab/ga-clean-urls.svg?branch=master)](https://travis-ci.org/MethodGrab/ga-clean-urls) [![npm](https://img.shields.io/npm/v/ga-clean-urls.svg)](https://www.npmjs.com/package/ga-clean-urls) ![File Size](http://img.badgesize.io/methodgrab/ga-clean-urls/master/index.min.js.svg?compression=gzip)\n\u003e A plugin for Google Analytics to remove UTM query strings from URLs\n\n\nThis plugin is heavily inspired by Wistia's [Fresh URL](https://wistia.com/blog/fresh-url) [library](https://github.com/wistia/fresh-url) but I wanted something more minimal so I've implemented its core functionality as a [Google Analytics plugin](https://developers.google.com/analytics/devguides/collection/analyticsjs/writing-plugins).\n\nBefore:\n```\nhttps://example.com/article/?utm_source=twitter\u0026utm_medium=tweet\u0026utm_campaign=website\u0026foo=bar\n```\n\nAfter:\n```\nhttps://example.com/article/?foo=bar\n```\n\n---\n\n### Warning:\nThis module is pre-1.0 and has not been thoroughly tested. Please test it yourself before using it in a production environment. Bugs can be reported on the [issue tracker](https://github.com/methodgrab/ga-clean-urls/issues).\n\n---\n\n## Install\n```bash\nnpm install --save ga-clean-urls\n```\n\n\n## Usage\nThe plugin must be loaded **after** the 'pageview' send so the UTM parameters are tracked correctly.\n\n```html\n\u003cscript\u003e\n\tga( 'create', 'UA-XXXXX-Y', 'auto' );\n\tga( 'send', 'pageview' );\n\n\t// Require the plugin after 'pageview' send\n\tga( 'require', 'cleanUrls' );\n\u003c/script\u003e\n\n\u003cscript async src=\"/path/to/ga-clean-urls/index.min.js\"\u003e\u003c/script\u003e\n```\n\n\n## Browser support\nIE10+.  \n\nThe plugin uses `history.replaceState` to manipulate the URL, if the browser does not support `history.replaceState` then it shouldn't cause any problems but the URL will remain unchanged.  \nSee http://caniuse.com/#feat=history for detailed browser support.\n\n\n## Todo\n- [ ] Add tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fga-clean-urls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmethodgrab%2Fga-clean-urls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethodgrab%2Fga-clean-urls/lists"}