“code” parameter


What is a short code?

When you save a Data Query template, it gives you a short code back. This short code is the short cut of the Data Query data set.
It is generally recommended to use short codes to ensure the best flexibility in reporting.


How do I alter a short-code API call?

By default, a short code will contain all of the items of the template: columns, sort, filters, site, etc.
If you need to change how the calls to the short code are sorted, it is possible to overload the short code in order to apply a new sort.

For example, here is our basic query:

You therefore need to change the way the calls to the short code are sorted, which is currently carried out in descending order on the metric “m_visits”. Should you need to sort this on another metric of the data set, just add it to the query as follows:

In the event of an overload on the columns parameter, all of the columns will be reset.

In the previous example the short code 2MEu4z contains the following columns: d_time_month,d_source,m_visits,m_conversions1_visits

During an overload, the short code will be as follows:

The result will only be the visits for the “d_page” column, and not the entire set of columns from the short code 2MEu4z plus the “d_page” column.

Was this post helpful?
Last update: 09/08/2017