Developer

Authentication

Three keys, each for a different job. Pick the right one and every request just works.

The three keys

DataCops has three ways to authenticate. A private API key (starts with dcp_) for server-to-server calls, a public key for the browser tracking script, and a session token for the dashboard. You will mostly use the private key.

Private API key

Send it in the x-dc-key header. Use it for reading your data and sending conversions from your server. Keep it secret, never put it in the browser.

HTTP
x-dc-key: dcp_your_private_api_key

Public key

This is the cop_key that goes in your tracking script URL. It is safe to appear in the browser. It only lets the script send events in.

Where to find them

Both keys live in the DataCops dashboard under Settings, API Keys.

Was this page helpful?