Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/browser-destinations/destinations/cj/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@segment/analytics-browser-actions-cj",
"version": "1.0.0",
"license": "MIT",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"main": "./dist/cjs",
"module": "./dist/esm",
"scripts": {
"build": "yarn build:esm && yarn build:cjs",
"build:cjs": "tsc --module commonjs --outDir ./dist/cjs",
"build:esm": "tsc --outDir ./dist/esm"
},
"typings": "./dist/esm",
"dependencies": {
"@segment/actions-core": "^3.158.0",
"@segment/browser-destination-runtime": "^1.87.0"
},
"peerDependencies": {
"@segment/analytics-next": ">=1.55.0"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions packages/browser-destinations/destinations/cj/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type { BrowserDestinationDefinition } from '@segment/browser-destination-runtime/types'
import { browserDestination } from '@segment/browser-destination-runtime/shim'
import type { Settings } from './generated-types'
import { CJ } from './types'
import sitePage from './sitePage'
import order from './order'

declare global {
interface Window {
cj: CJ
}
}

export const destination: BrowserDestinationDefinition<Settings, CJ> = {
name: 'Commission Junction (Actions)',
slug: 'actions-cj',
mode: 'device',
description:
'The Commission Junction Browser Destination allows you to install the CJ Javascript pixel onto your site and pass mapped Segment events and metadata to CJ.',
settings: {
tagId: {
label: 'Tag ID',
description: 'Your Commission Junction Tag ID.',
type: 'string',
required: true
},
actionTrackerId: {
label: 'Action Tracker ID',
description:
'Used with the "Order" Action only. Can be overridden at the Action level. This is a static value provided by CJ. Each account may have multiple actions and each will be referenced by a different actionTrackerId value.',
type: 'string'
}
},
initialize: async () => {
if (!window.cj) {
window.cj = {} as CJ
}
return window.cj
},
actions: {
sitePage,
order
}
}

export default browserDestination(destination)
Loading
Loading