# FastStats configuration

Before configuring Twitter in FastStats, make sure you've created a Social database (see [Twitter prerequisites](<https://help.apteco.com/en/admin/integration/social/twitter/index.md#creating-a-social-database>)).

## FastStats Service configuration

Open the **FastStats Configurator**:

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_net_configuration.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_net_configuration.png>)

To configure the Social database connection for the FastStats Service:

1. Select **FastStats Services**.
2. Select the **System** tab.
3. Select the **Twitter** node.

   [![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_database_connection_string.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_database_connection_string.png>)
4. Select **File** \> **Save** to save the changes.

| Setting | Description |
| --- | --- |
| Database Connection String | Automatically picks up the connection string from the Social database. |
| Image/Media upload timeout (seconds) | Timeout for uploading images or video to a Twitter Handle. Increase if your network is slow or you are using large files. |
| Image/Media upload filesize limit (MBs) | The maximum file size for Twitter is 5 MB. |
| Ad country codes | Default country codes for targeting custom audiences in adverts. You can also set this per channel in PeopleStage. |
| Ads campaign retry interval (minutes) | How often PeopleStage checks with Twitter whether the audience has loaded successfully. |
| Ads campaign maximum retry period (hours) | How long the service retries connecting to Twitter for audience upload progress before stopping. |

## FastStats Web Service configuration

Define the Social database connection string for the FastStats Web Service.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_web_service_configuration.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/FastStats_web_service_configuration.png>)

## FastStats roles configuration

Roles control access to Twitter functions.

### Twitter Administrator role

A Twitter Administrator can modify Apps, modify Handles, and manage tokens.

1. In **Users Explorer**, right-click on an administrator.
2. Select **Modify** \> **Modify Roles**.

   [![](<https://help.apteco.com/assets/images/admin/integration/social/FastStats_Admininistrators_Modify_ModifyRoles.png>)](<https://help.apteco.com/assets/images/admin/integration/social/FastStats_Admininistrators_Modify_ModifyRoles.png>)
3. Select both the **Twitter Administrator** and **Twitter User** roles.

   [![Modify Roles: Twitter Administrator and User](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/013_ModifyRoles_Twitter_Admin_and_User.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/013_ModifyRoles_Twitter_Admin_and_User.png>)
4. Select **Close**.

### Twitter User role

A Twitter User can manage tokens within Administrative Functions.

1. In **Users Explorer**, right-click on a username.
2. Select **Modify** \> **Modify Roles**.

   [![](<https://help.apteco.com/assets/images/admin/integration/social/FastStats_Users_Users_Modify_ModifyRoles.png>)](<https://help.apteco.com/assets/images/admin/integration/social/FastStats_Users_Users_Modify_ModifyRoles.png>)
3. Select the **Twitter User** role.

   [![Twitter User Role](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/013_ModifyRoles_Twitter_User.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/013_ModifyRoles_Twitter_User.png>)
4. Select **Close**.

## Administrative functions

Administrative functions are available from **File** \> **Tools** \> **Administrative Functions**.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Administrative_functions.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Administrative_functions.png>)

A user with the Twitter Administrator role can Modify Apps, Modify Handles, and Manage Tokens. A user with only the Twitter User role can only Manage Tokens.

### Modify Apps

FastStats requires the Twitter App Id, Consumer Key, and Consumer Secret so users can obtain the correct Access Tokens. This uses FastStats' built-in Twitter login mechanism.

Obtain these from the [Twitter Developer portal](<https://developer.twitter.com>).

[![](<https://help.apteco.com/assets/images/admin/integration/social/Modify_apps.png>)](<https://help.apteco.com/assets/images/admin/integration/social/Modify_apps.png>)

- To add a new App, select **Add New Twitter App**
- To edit an existing App, select **Edit** next to the App Name

  [![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Update_twiter_app.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Update_twiter_app.png>)

Apteco provides a shared Twitter App. To use it, select **Use the Apteco twitter app**. FastStats automatically populates the name and hides the App Id, Consumer Key, and Consumer Secret fields.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Update_twitter_app_own_app.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Update_twitter_app_own_app.png>)

| Field | Description |
| --- | --- |
| Name | Used internally within FastStats; should match the app name in the Twitter Portal (or "Apteco" if using the Apteco App) |
| App Id | The Twitter App Id (only required if using your own app) |
| Consumer Key | The Twitter App Consumer Key (only required if using your own app) |
| Consumer Secret | The Twitter App Consumer Secret (only required if using your own app) |
| Redirect URI | Used for click-through actions from Twitter; typically your brand's home page |

### Modify Handles

To find your Twitter Handle, log in to Twitter and select your profile picture. Your Handle appears under your name, starting with @.

1. To add a new Handle, select **Add New Twitter Handle**.
2. To edit an existing Handle, select **Edit**.

   [![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_handles.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_handles.png>)
3. Enter the Twitter **Handle Username**.

   [![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Add_twitter_handles.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Add_twitter_handles.png>)

### Twitter capabilities configuration

This configuration lets FastStats users log in to their Twitter profile and generate user access tokens for Apps and Handles.

In **Users Explorer**, right-click on a user and select **Modify** \> **Modify Capabilities** \> **Modify Twitter Capabilities**.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_twitter_capabilities.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_twitter_capabilities.png>)

**Manage Ads**: select to let the user publish adverts, upload custom audiences, and gather adverts statistics.

**Tweets**: select to let the user publish tweets and gather tweet responses.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_twitter_capabilities_2.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Modify_twitter_capabilities_2.png>)

### Manage Tokens

A Twitter User role can see the Apps and Handles assigned by an administrator.

When you first access the Manage Tokens dialogue, select **Generate**.

[![](<https://help.apteco.com/assets/images/admin/integration/social/Manage_tokens.png>)](<https://help.apteco.com/assets/images/admin/integration/social/Manage_tokens.png>)

The Twitter login dialogue opens. Enter your Twitter credentials. FastStats stores these as a token.

After successfully logging in, close the dialogue. The **Valid** check-boxes for the App and branded Handles show as ticked once FastStats validates the tokens.

[![](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Manage_tokens_2.png>)](<https://help.apteco.com/assets/images/admin/integration/social/twitter/faststats-configuration/Manage_tokens_2.png>)

If tokens become invalid, select **Re-Generate** to request a new set.

> [!NOTE]
>
> Without valid tokens stored in FastStats, it's impossible to create Tweets or Adverts activities in PeopleStage.
