How to extract data?

Not applicable

Hello everyone,

I have a backend with an uri like this :

https://***/***/{countryCode}/{locale}/{resource}

locale = fr or en etc .. (language)

countryCode = fr or ma etc..

resource = /design etc...

I want to know what is the most used resources by country by developer.

How can I do this?

Thank you so much.

2 3 379
3 REPLIES 3

Good question!

To allow this analysis, you first need to adjust your API proxy. Insert a StatisticsCollector policy to store the custom analytics field of "country" or "countryCode". What this does is store the values of countrycode and resource, for each request received, into the Apigee Edge analytics datastore. These fields then become available for inclusion in custom analytics reports, later.

Probably before calling the StatisticsCollector, you will want to extract the countrycode and resource from the urlpath. For that you will use the ExtractVariables policy.

Examples:

extract variables:

<ExtractVariables name="ExtractVariables-1">
   <Source>request</Source>
   <URIPath>
      <Pattern ignoreCase="true">/something/{countryCode}/{locale}/{resource}</Pattern>
   </URIPath>
</ExtractVariables>

stats collector:

<StatisticsCollector name="Stats-CountryCode">
  <Statistics>
    <Statistic name="countryCode" ref="countryCode" type="string">NA</Statistic>
    <Statistic name="resource" ref="resource" type="string">NA</Statistic><br>
  </Statistics>
</StatisticsCollector>

Include those policies into your API proxy. And then design and view your custom report, as described here.

Not applicable

Hi Rayan,

Good question. There are multiple ways to do it. Below are 2 ways.

1. Using Custom Reports.

a. Create a custom report by resource or path.suffix, which will give the data by country/locale/resource.

b. Extract the data to XL or csv.

c. Split the first column resource/path.suffix country/locale/resource to three columns as country, locale and resource using / as delimiter.

d. There you go.

2. Using Custom Dimensions ( StatisticCollector )

a. Extract the country, locale, resource to variables.

b. Use StatisticCollector policy to push those into Analytics database.

c. Again, you can use custom reports to get the data by country, locale and resource, which will be available in Custom Dimensions section of drilldown.

It's not by developer so?