1. Home
  2. Docs
  3. Optimize
  4. Advertiser Pixel
  5. JDX Function

JDX Function


The JDX Function is the heart of the pixel. It allows you to control when, what, and how things are sent to our system. There function is divided into three separate types of uses:

  • Request: Sends a request to our system
  • Config: Sets up the pixel configurations for every request that follows
  • Option: Sets the options on the next request made and will be reset following its completion

The jdxtag() function’s first argument is the action it will take and is followed by any required or optional parameters needed for that action:


jdxtag(<ACTION>, <PARAMETERS>)


The type of actions available for the JDX Function are: _click, _conversion, _track, options, metadata, and config. See the details for each action below for the specific parameters required.

Ensure that when using the jdxtag() function on an HTML page you have it wrapped in a <script> tag or no action will be made.

Request

There are three types of requests you can make to our servers:

  • Click
  • Conversion
  • Track

Each request allows you to report metrics into our system so we can keep track of how jobs are performing for you. These numbers can used for publisher payments as well as figuring out how to plan your campaigns.

Click

This type of request is used when you want to report that a user has visited a job on your website. By telling us that a user has visited a job page we can create reports for you to better understand a job’s performance.

In order to send a click request you will need to pass _click as the first parameter and the identifier of the job the user is currently on:


jdxtag('_click', 'id-123Ae')

The mandatory job identifier is used to connect to a job in our system. Ensure that the job identifiers you are using within you pages are the ones that have been assigned to the job within our system so that reports can be properly generated.

Conversion

Tracking conversions for your job is done using the _conversion parameter. Whenever you get an applicant make sure to send a request to our system so it can be reflected in our reporting. A _conversion request is executed like so:


jdxtag('_conversion', 'id-AF3FE01')

A _conversion request takes a mandatory job identifier as the second parameter which we use to connect to a job in our system. Ensure that the job identifiers you are using within you pages are the ones that have been assigned to the job within our system so that reports can be properly generated.

Track

There may be instances that you want to track users on other pages that do not belong to jobs. For this you can use the _track request. This reports a visit to our system for the page the user is currently on which is used when generating page analytics. There is no second parameter for a _track request, just pass the action:


jdxtag('_track')

Config

Our pixel maintains a global config that persists for every request you make on a page. Typically you’ll set Config variables in the <head> tag (see the Head Snippet section for an example of config usage) so that any requests made from the tag on the page will include your config changes. However, you can update the config from anywhere, just note that jdxtag() function calls happen in order so any config changes applied only alter subsequent requests.

The Config action takes a variable name as the second parameter and a third parameter with the value you want to set that variable to. Depending on the variable, there may be additional parameters. Refer to the documentation on specific config variables for proper usage.

Config actions include:

  • Set Pixel
  • Pixel Time Zone
  • Do Not Track
  • Set Pixel

Set Pixel

This config action is mandatory and must be set before making any requests. This variable accepts a string value which is your pixel’s UUID. To find the UUID our system has assigned to your account please visit the platform, log into your dashboard, and visit the account’s pixel page.


jdxtag('config', '_setPixel', 'bdc609ea-9675-402f-ac5d-130ce1bfc4a5')

Pixel Time Zone

This config action is mandatory and must be set before making any requests. This variable accepts a string value which is the timezone you specified when you created your account. To see what this variable is for your account please visit the platform, log into your dashboard, and visit the account’s pixel page.


jdxtag('config', '_pixelTimeZone', 'EST')

Do Not Track

If you allow users to opt out of being tracked you can set their decision by passing a boolean value to the Do Not Track action. If set to true then requests will not be sent to our system. In order to stay flexible we’ve left how you keep track of a user’s Do Not Track status up to you. Just make sure whenever they go to a new page the status is re-affirmed.


jdxtag('config', '_doNotTrack', true)

If you want requests to be sent but you do not want to send user data, please use the Ignore Params action to turn off what is being tracked on your users.

Options

When making requests there are times where you want to make adjustments on how the data is being sent to our system. We provide various Option actions to give you flexibility. Note that unlike Config actions, these actions do not persist between requests. If you want to make multiple requests with the same options you’ll need to re-apply them before each request is made.

Option actions include:

  • Current URL
  • Referrer URL
  • Ignore Params
  • Current URL

Current URL

This action allows you to override the browsers current URL. Some practical uses of this option could be:

  • That you have sensitive URL parameters that you don’t want sent to us
  • Your website is a Single Page App (React, Angular, etc) and it doesn’t update the browser’s internal URL
  • Your website uses AJAX and/or modals and you want distinct URLs and/or parameters sent to our system

This option accepts a string which you can enter the URL of the current page the user is visiting.


jdxtag('options', '_currentUrl', 'http://www.your-website.com/route/page')

Referrer URL

If you need to override the referrer URL because the one stored in the browser is not accurate you can use the Referrer URL action. This is especially important for Single Page Apps (React, Angular, etc) that do not update the referrer URL at all. If you want to accurately track how users are navigating your website you will need to make sure the referrer URL being passed to our system is correct.


jdxtag('options', '_referrerUrl', 'http://www.your-website.com/route/referrer-page')

Ignore Params

Our pixel tracks various user attributes we get from the browser. This is useful for tracking user behaviour. However, there may be instances where you do not want certain data tracked on your user. To have the pixel ignore certain browser attributes use the Ignore Params action and pass an array of attributes (as strings) that you want ignored.


jdxtag('options', '_ignoreParams', ['_userAgent', '_browser'])

Optimize Pixel Ignore Params

List of all pixel params that an can be ignored:
ParamDescriptionExample
_userAgentThe specific browser with version being used by a userMozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0
_browserThe browser of the userChrome
_mobileA boolean value as to whether they are on mobileTRUE
_screenSizeA width by height string value of the browser’s screen size in pixels1600x900
_colorAn integer with the color depth on the user’s browser24
_referrerThe URL that the user came from before the current pagehttp://www.website.com/route/page
_encodingThe character set on the user’s browserUTF-8
_languageThe native language set on the user’s browseren-US
_locationThe current URL that the user is onhttp://www.website.com/route/page
_timezoneThe timezone that the user’s browser is inAmerica/New York

Note that if you want to add multiple ignore params you must add them all at once. Any additional calls of the Ignore Params action will overwrite the previous values:

Problematic:


jdxtag('options', '_ignoreParams', ['_language', '_color'])
jdxtag('options', '_ignoreParams', ['_timezone'])
// Now only _timezone will be ignored, the _language and _color will still be present in the request!
jdxtag('_conversion', 'jid-1AFO3')

Good:

jdxtag('options', '_ignoreParams', ['_language', '_color', '_timezone'])
// Now all three parameters will be ignored in the request!
jdxtag('_conversion', 'jid-1AFO3')

Metadata

If you need additional information attached to a request so you can better understand or organize your data, you can use the Metadata action. When using this action you also must include a key and a value which will be stored by Optimize. Note that the key and the value must both be of type String and the key must only include alphanumeric characters (_ and – also allowed as separators) in order to be valid:


jdxtag('metadata', 'a_key-example', 'A string value')

There is a maximum of 5 metadata parameters allowed per request, and you must make sure to run the metadata functions before you run the desired request:


// Set metadata
jdxtag('metadata', 'job-type', 'Sales')
jdxtag('metadata', 'company', 'Widget Corp')
// Then send request!
jdxtag('_track', 'company', 'Widget Corp')