npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

greenbricks_cps

v0.1.3

Published

Greenbricks CPS(성과 추적)용 브라우저 SDK입니다. URL에 **`click_id`**, **`adv`**, **`media`**가 모두 있으면 해당 값을 쿠키에 암호화해 두고, URL에 경쟁사 추적 파라미터만 있으면 Greenbricks 쿠키를 지웁니다.

Readme

greenbricks_cps

Greenbricks CPS(성과 추적)용 브라우저 SDK입니다. URL에 click_id, adv, **media**가 모두 있으면 해당 값을 쿠키에 암호화해 두고, URL에 경쟁사 추적 파라미터만 있으면 Greenbricks 쿠키를 지웁니다.

설치

npm install greenbricks_cps
# 또는
yarn add greenbricks_cps

사용법

ESM

import greenbricksCps from 'greenbricks_cps'

// 모듈을 불러오면 페이지 로드 시 initCpsTracking()이 한 번 실행됩니다.
// 필요하면 직접 다시 호출할 수 있습니다.
greenbricksCps.initCpsTracking()

// 저장된 추적 값 읽기 (복호화된 값)
const { gbClickId, gbAdv, gbMedia } = greenbricksCps.getTrackingData()

개별 함수 import

import {
  initCpsTracking,
  getTrackingData,
  getGbTrackingParams,
  applyGbAttribution,
  clearGbAttribution,
  hasCompetitorTrackingParams,
} from 'greenbricks_cps'

CDN / <script> 태그 (IIFE)

번들된 greenbricks-cps.js는 **전역 객체 GreenbricksCps**에 named export와 default를 붙입니다. 스크립트 로드 시 모듈이 한 번 실행되어 initCpsTracking()도 자동 호출됩니다.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/greenbricks-cps.js"></script>
<script>
  GreenbricksCps.initCpsTracking()
  const data = GreenbricksCps.getTrackingData()
  // 동일 API: GreenbricksCps.default.initCpsTracking() — default 객체로도 접근 가능
</script>

같은 파일을 jsDelivr·unpkg 모두에서 쓸 수 있습니다. 버전 고정은 @0.1.2, 최신은 @latest로 바꾸면 됩니다.

<script src="https://unpkg.com/greenbricks_cps@latest/dist/greenbricks-cps.js"></script>

빌드 산출물은 dist/greenbricks-cps.js이며, yarn build 시 함께 생성됩니다.

동작 요약

| 상황 | 동작 | |------|------| | URL에 click_id, adv, media모두 있음 | gb_click_id, gb_adv, gb_media 쿠키에 암호화 저장(24시간), 경쟁사 관련 쿠키 삭제 | | 위 셋이 없고, URL에 경쟁사 추적 파라미터만 있음 (apclid, lpinfo, tenpingid, _gcl_aw, _fbc, _fbp, aw_campaign, _irclickid 등) | Greenbricks 쿠키 삭제 |

주요 API

| 함수 | 설명 | |------|------| | initCpsTracking() | 위 규칙에 따라 쿠키 적용/정리 | | getTrackingData() | { gbClickId, gbAdv, gbMedia } — 쿠키에서 복호화한 값, 없으면 해당 필드는 null | | getGbTrackingParams() | 현재 URL에서 click_id / adv / media를 읽은 { clickId, adv, media } 또는 null(하나라도 없으면 null) | | hasCompetitorTrackingParams() | URL 쿼리에 경쟁사 추적 파라미터가 하나라도 있는지 | | applyGbAttribution(tracking) | GbTrackingParams로 GB 쿠키 설정 + 경쟁사 쿠키 삭제 | | clearGbAttribution() | GB 쿠키만 삭제 |

상수 GB_COOKIE_NAMES, COMPETITOR_COOKIE_NAMES로 쿠키·파라미터 이름 목록을 확인할 수 있습니다.

라이선스

MIT