ClickCease
Post impressions made with TypeScript

Fast-Guide to Implement Post Impressions in your TypeScript App

Italo Orihuela
Italo Orihuela
Engineer
Android
iOS
Web
Mar 30, 2024

Whether you’re a content creator, a community manager, or a business owner, knowing how your content performs and who interacts with it can be a game-changer. This is where the concept of ‘Post Impressions’ comes into play. Post Impressions provides you with valuable insights into your content’s performance and user engagement. It’s like having a key metric that helps you understand your audience better, tailor your content more effectively, and ultimately, foster a more vibrant and engaged online community. So, are you ready to unlock the power of Post Impressions?

Pre-requisites:

Before we start, ensure you have the following:

  1. Basic knowledge of TypeScript
  2. An installed and configured TypeScript environment
  3. The Amity SDK installed in your project
  4. An Amity Social Cloud Portal account
  5. An Amity Social Cloud Console Account

Note: If you haven’t already registered for an Amity account, we recommend following our comprehensive step-by-step guide in the Amity Portal to create your new network.

Step 1: Understanding Post Impressions

The first step is understanding what Post Impressions are. In the Amity Social Cloud SDK, impressions represent the number of users who viewed the post, while reach represents the number of unique users who viewed the post. This data is not updated in real-time but almost in real-time, providing you with a near-accurate representation of your post’s performance.

Step 2: Marking a Post as Viewed

The SDK provides a method to mark any post as viewed. This is done by invoking the markAsViewed() method within post.analytics. This action increases the impression and reach count of specific posts. You can access the impression and reach counts directly from the post object within the SDK. The code snippets provided in the context information above show how to mark a post as viewed in iOS, Android, TypeScript, and Flutter.

Step 3: Accessing Impression and Reach Counts

Once a post is marked as viewed, you can access the impression and reach counts. This data provides valuable insights into how your content is performing. For instance, a high number of impressions but a low reach could indicate that the same users are viewing your post multiple times. On the other hand, a high reach with fewer impressions could mean that your post is reaching a wider audience.

Step 4: Querying Post Reached Users

The SDK also provides a function to query a list of unique users who have viewed a specific post. This is done using the queryReachedUsers() function within UserRepository. This function requires two parameters: viewedType and viewedId. The viewedType represents the type of content that has reached the users (in this case, it is type ‘POST’), and the viewedId corresponds to the ID of the viewed content (in this case, it is post). The context information above provides code snippets on how to query post reached users in iOS, Android, TypeScript, and Flutter.

Step 5: Analyzing the Data

The final step is analyzing the data you’ve collected. This data can provide valuable insights into user engagement and content performance. For instance, you can identify which types of posts are most popular, what times of day users are most active, and which users are most engaged. This information can help you tailor your content and engagement strategies to better meet the needs and interests of your community.

Final Thoughts

The Post Impression feature of the Amity Social Cloud SDK is a powerful tool for understanding user engagement and enhancing community insights. By marking posts as viewed, accessing impression and reach counts, and querying post reached users, you can gain valuable insights into how your content is performing and who is actively engaging with it. This information can help you develop more effective community engagement strategies and foster a more vibrant and engaged online community. Feel free to give it a try with Amity!