{"id":24383251,"url":"https://github.com/firstandthird/hapi-campaigns","last_synced_at":"2025-12-28T04:23:35.770Z","repository":{"id":54326168,"uuid":"111492426","full_name":"firstandthird/hapi-campaigns","owner":"firstandthird","description":"campaign tracking","archived":false,"fork":false,"pushed_at":"2021-02-23T22:14:26.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T09:40:24.654Z","etag":null,"topics":["hapi-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/firstandthird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-21T03:10:45.000Z","updated_at":"2021-02-23T22:14:25.000Z","dependencies_parsed_at":"2022-08-13T12:01:18.191Z","dependency_job_id":null,"html_url":"https://github.com/firstandthird/hapi-campaigns","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-campaigns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-campaigns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-campaigns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-campaigns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstandthird","download_url":"https://codeload.github.com/firstandthird/hapi-campaigns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243258504,"owners_count":20262301,"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":["hapi-plugin"],"created_at":"2025-01-19T10:14:00.741Z","updated_at":"2025-12-28T04:23:35.736Z","avatar_url":"https://github.com/firstandthird.png","language":"JavaScript","readme":"# hapi-campaigns\n   A hapi server plugin that provides automatic tracking of campaigns and UTM campaigns\n\n## installation\n\n   Go to your project directory and do\n```console\nnpm install hapi-campaign\n```\n\n  Register the plugin with your hapi server with\n\n```javascript\nconst hapiCampaigns = require('hapi-campaigns');\nconst server = new hapi.Server({ port: 8000 });\nawait server.register(hapiCampaigns);\n```\n\n## How it Works\nhapi-campaigns parses every incoming request to your\nserver for a campaign (or utm_campaign) cookie.  It will\nautomatically extract any values associated with the campaign\ncookie (separated by '_'), and for utm_campaigns will extract\nutm_medium / utm_source fields.  It also registers a 'campaign'\nevent that is called any time a campaign matching the specified cookie name is detected.\n\n\n## Example\nIf you register an event handler like:\n```javascript\nserver.events.on('campaign', (data) =\u003e {\n  console.log(data.hello);\n});\n```\n\nWhen you call the route `/foo?campaign=visit_world` your\nserver will print:\n\"world\"\n\n## Options\n\n- __cookieName__\n\nThe cookie associated with your campaign, default value is _campaigns64_\n- __cookie__\n\n- __ttl__\n\nThe TTL for the cookie, by default the cookie will last 30 days.\n\nA JSON object specifying the cookie's properties, these along with their defaults are:\n  - __isSecure__: false\n  - __isSameSite__: false\n  - __isHttpOnly__: true\n  - __clearInvalid__: true\n  - __ignoreErrors__: true\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-campaigns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstandthird%2Fhapi-campaigns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-campaigns/lists"}