Category: Code Samples

Content.ad allows publishers to segment reports based on their visitors’ utm_source and utm_campaign parameters with ease. Alternatively, with a bit of custom code, you can specify your own custom values to track. To get started, you will need to let us know values you would like grouped in your reporting dashboard.

You can specify up to 20 values for each dimension that will be grouped in your reporting dashboard. In the “My Account” section in your Content.ad account, click on “Traffic Sources”. Enter the desired values. For example, if you want to see reporting by traffic with the utm_source value of “FB”, enter “FB” under “Source”.

To see reporting by your dimension values in the dashboard:

Choose “Widget Report” from the “Report” drop-down at the top right.

Click on “Traffic Sources” in the Show results by section.

Optionally, you can email your account rep or support@content.ad to receive a daily click report that will include all values that you pass. This is useful if you need to record more than 20 values in either dimension. Please note that this report does not include impression data, so you may need to join to your own analytics.

Our guidelines prohibit passing user-identifying information through these parameters. We recommend using general values; for example, pass the page title instead of the full URL or the device type (ex. “mobile”) instead of the full user agent.

Customizing your dimensions

If you want to track values other than your visitors’ utm_source or utm_campaign parameters, you can pass any desired value into the parameters “clientId” and/or “clientId2” in your widget installation code (more info). In your reporting dashboard, clientId and clientId2 values will be reported as source and campaign, respectively.

You may wish to show content with a different rating to visitors from different sources of traffic or track certain sources separately in reports. You can do this by setting up different widgets for each desired source and using a simple JavaScript conditional statement to switch between widgets with the desired settings.

In addition to the default widget, create and configure an additional widget for each traffic source that requires separate settings or tracking.

Ensure that visitors from the desired traffic sources are using URLs with a parameter unique to that source.

http://example.com?utm_source=adsinc

Add JavaScript to your page that swaps the widget ID and unique ID in the needed places based on the unique parameter. In the example below, a specific widget is displayed for traffic from “adsinc”, while the default widget is used for all other traffic: