Custom targeting

Custom targeting is a module that is used to configure special types of targetings.

In addition to the existing targeting options (by time, frequency, geography, and so on), the account administrator can set up to 63 additional characteristics with arbitrary values and use them to target their campaigns.

If Adfox determines the values for standard targeting types independently, then characteristic values for additional targeting should be passed to the ad tag from the site page.

You should contact the developers/administrators of your site to learn how to pass parameters to the ad tag. Below, we'll review what exactly needs to be passed and how to set up custom targetings in the Adfox system.

Add characteristics

Custom characteristics are set up on the Settings → Custom targeting tab.

Step 1. Add a targeting characteristic

  1. Click the Settings button opposite the characteristic you need. This will open a window with settings.

  2. Enable the use of the characteristic.

  3. Set the parameters:

    • Name: The name of the characteristic on the Custom targeting tab.

    • Targeting name: The name of targeting for this characteristic in the campaign settings.

    • Report name: The name of the report on this characteristic in the list of reports.

  4. Click Change.

  5. If necessary, add other characteristics the same way.

Step 2. Add values for the new characteristic

After you've added the characteristic, the Values and Groups of values buttons will appear next to it on the Custom targeting tab. To add values:
  1. Click Values → Add. This will open a window with settings.

  2. Set the parameters:

    • ID: The parameter passed to the ad tag. The ID must only consist of Latin letters, numbers and special characters %+.=/()-.

    • Value: The name of the value in the targeting settings of the campaign and in the reports.

    • Don't target current campaigns by this value: This option disables the display of previously configured ads to users who match this value. This only applies to the campaigns created before the value was added. In new campaigns, this default value will be included in targeting.

    • Don't disable in campaigns where all values are enabled (targeting is not set): Enable this option if you don't want the new value to affect the targeting of existing campaigns. So, if all the values of the characteristic are included in targeting (that is, targeting is not set), the new value will also be included in targeting (targeting will remain not set). If only a few values are included in targeting, the value being added won't be included in it (targeting settings won't change).

  3. Add other values of the new characteristic the same way.


    The maximum allowed number of values for one characteristic is 10,000.

You can combine values into groups. Then, when setting up targeting for a campaign, you'll be able to select all the required values with one click. For example, you added the “age” characteristic and specified values for it from 15 to 35. Usually you set up targeting by age ranges: from 15 to 20, from 21 to 25, from 26 to 30, and from 31 to 35 years old. Create four corresponding groups and include the required values in them. Then, when setting up a campaign, you won't need to list all the values in the targeted range. You'll just select a group, and all the required values will be included automatically.

To add a group of values:

  1. Select Groups of values on the Custom targeting tab next to the characteristic you need.

  2. In the window that opens, click Add and specify the name of the group.

  3. Click Values and select the values for this group.

  4. Click Change. The group will appear in the targeting settings for the campaign.

Set up custom targeting

Targeting is set on the Targeting → Custom targeting tab.

Select a characteristic from the list, check all the required values, and click Change. After that, you can select the next characteristic from the list and apply the same settings. If groups of values are added to a characteristic, you can manage the list of values by enabling and disabling groups only.

The <unknown, not set> option determines whether to show banners in cases when no value is passed to Adfox at all, or a value is passed that's missing from the list of characteristic values.

Change the ad tag

If custom targeting characteristics were enabled after the ad tags were installed on the site, you need to add new parameters to the ad tag or retrieve the tags in the interface.

Add parameters to the ad tag

Add the puidN: value parameter to the params object, where N is the number of the characteristic from 1 to 63, and value is the value for targeting.

You can pass multiple values to a single parameter separating them by : (colons). If the campaign is targeted at least one of the received values, it will be shown.

Example 1. Adding puid1 with a single value and puid2 with multiple colon-separated values:

params: {
    pp: 'g',
    ps: 'bnfx',
    p2: 'evbi',
    puid1: 'woman',
    puid2: '16:17:18:19'
Adding parameters to the mobile app code

Use an AdRequest object to pass the adf_puidN parameter, where N is the number of the characteristic from 1 to 63 and the value for targeting.

Example (Android):

Map<String, String> parameters = new HashMap<String, String>();
parameters.put("adf_puid1", "value");

Example (iOS):

NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
parameters[@"adf_puid1"] = @"value";
Add parameters for XML codes

Add a parameter with a value as name=value& or name=value& (depending on the selected parameter separator), where name is the name of the parameter (puidN), and value is the value without quotes.

Example of adding puid1 with a single value and puid2 with multiple colon-separated values:<random>&dl=<page_url>&puid1=woman&puid2=16:17:18:19

The above code will show campaigns targeted at 16-year-old female visitors.


If a single value was passed from the site page to the parameter, it will also be recorded in the log, and the report will be generated based on this recorded value.

If several values were passed from the site page to the parameter at the same time, the report is generated as follows:

  • The log will record the value that has the largest valueID, the system identifier of the characteristic value.

  • If the campaign wasn't targeted at this value but could be shown due to any other value passed in the request, the value that had the highest valueID and was recorded in the log will appear in the report. But this doesn't mean that the campaign was shown incorrectly according to the targeting settings.

Example: The request passes values to puid1=g38:m38:m42:m21.

For characteristic 1, we have the following value directory:

valueID ID (passed to the ad tag) Value (shown in the interface)
25190 g38 Cartoons for children
25192 m38 Russian cartoons
25195 m42 Cartoons animated series

valueID = 0: Have unknown values passed to the request code.

There is a campaign targeted at an unknown value if the first three values are disabled.

With a request like this, the campaign is shown because an unknown value is received in the request. One of the received values will be recorded in the log, namely m42, because it has the largest valueID. The impression will be counted by the “Cartoons animated series” value in the report on this campaign. There is no error in the campaign impression because the value allowed for the impression was passed in the request.

Contact support

Send an email