# How to set up In-app analytics

**URL:** <https://forum.communityhealthtoolkit.org/t/how-to-set-up-in-app-analytics/1533>\
**Category:** Technical Support\
**Created:** [October 27, 2021, 2:06pm UTC](https://forum.communityhealthtoolkit.org/t/how-to-set-up-in-app-analytics/1533 "2021-10-27T14:06:01Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [December 1, 2021, 10:28am UTC](https://forum.communityhealthtoolkit.org/t/how-to-set-up-in-app-analytics/1533/37 "2021-12-01T10:28:08Z")

</div>

jkuester  
We are preparing for end of semester exams, thus took a break, I still cant be able to display the data, only widgets available, and my code is as below:  
_target config_

```auto
const extras = require('./nools-extras');

const {
  posCovidPercTested,
  negCovidPercTested,
 } = extras; 

module.exports = [  
  {
    id: 'percentage-positive-covid-test',
    type: 'percent',
    icon: 'medic-covid-case',
    goal: -1,
    translation_key: 'targets.posCovid.title',
    subtitle_translation_key: 'targets.this_month.subtitle',
    appliesTo: 'contacts',
    appliesToType: ['person'],
    passesIf: posCovidPercTested,
    date:'reported',
  },

  {
    id: 'percentage-negative-covid-test',
    type: 'percent',
    icon: 'medic-covid-case',
    goal: -1,
    translation_key: 'targets.negCovid.title',
    subtitle_translation_key: 'targets.this_month.subtitle',
    appliesTo: 'contacts',
    appliesToType: ['person'],
    passesIf: negCovidPercTested,
    date:'reported',
  },

];

```

_nools-extra_

```auto
const posCovidPercTested = contact => {
  return contact.reports.some(report => report.form === 'case_investigation' && report.fields.testing.cov_test === 'Positive');
};

const negCovidPercTested = contact => {
  return contact.reports.some(report => report.form === 'case_investigation' && report.fields.testing.cov_test === 'Negative');
};

module.exports = {
  posCovidPercTested,
  negCovidPercTested,
 }; 

```

On it now and was following your thread, Did you end up implementing an `appliesIf` function in your target? **No I didn’t**  
Given I just want to get percentage of people with Covid, how will the appliesif function look like?  
Trying to figure this out

---

_[View the full topic](https://forum.communityhealthtoolkit.org/t/how-to-set-up-in-app-analytics/1533)._
