{"id":18974981,"url":"https://github.com/bufferapp/buffer-js-utms","last_synced_at":"2026-04-08T18:30:17.367Z","repository":{"id":57100701,"uuid":"220965806","full_name":"bufferapp/buffer-js-utms","owner":"bufferapp","description":"Functions to extract UTM parameters with expiration","archived":false,"fork":false,"pushed_at":"2019-11-11T12:40:57.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T11:35:44.178Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bufferapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-11T11:25:25.000Z","updated_at":"2024-09-23T09:30:14.000Z","dependencies_parsed_at":"2022-08-20T17:30:49.613Z","dependency_job_id":null,"html_url":"https://github.com/bufferapp/buffer-js-utms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fbuffer-js-utms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fbuffer-js-utms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fbuffer-js-utms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bufferapp%2Fbuffer-js-utms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bufferapp","download_url":"https://codeload.github.com/bufferapp/buffer-js-utms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239972515,"owners_count":19727394,"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":[],"created_at":"2024-11-08T15:16:52.477Z","updated_at":"2026-04-08T18:30:17.306Z","avatar_url":"https://github.com/bufferapp.png","language":"JavaScript","readme":"# Buffer's UTM extracting helper fuctions\n\nThis module offers some basic logic to extract UTM parameters from the\nquery string. It returns them in a simple data structure that includes a\nTTL so that we can define when to discard the found UTM parameters\n\nThis module is currently shared between `buffer-login` and `buffer-marketing`\nto handle UTM tracking in a consistent way\n\n## Install\n\n```\nnpm install @bufferapp/utms --save\n```\n\n## Usage\n\nThe main API to this module is `refreshUtms(query, previousUtms)`, it takes\nthe curret query parameters (object) and the previous value returned by this\nfunction (which includes both the extracted UTMs and the TTL info)\n\nThis package does not take care of storing previous UTMs, a simple way to use\nit is by storing them in the users session:\n\n```\nconst { refreshUtms } = require('@bufferapp/utms')\n\nmiddleware.trackUtm = (req, res, next) =\u003e {\n  req.session.utms = refreshUtms(req.query, req.session.utms)\n\n  next()\n}\n```\n\nWith the above middleware, the currently valid UTMs for the request would be available\nin `req.session.utms.values`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fbuffer-js-utms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbufferapp%2Fbuffer-js-utms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbufferapp%2Fbuffer-js-utms/lists"}