How are Views, Unique Views, and Clicks counted via API?

Prev Next

When retrieving a post for a specific user using the API, Views and Unique Views are automatically tracked based on the user_id passed in the request. This means that each time a post is fetched for a given user_id, the system counts the view, and if it’s the first time the user is viewing the post, it counts as a unique view.

  • No additional endpoint is required for tracking views and unique views. These are automatically recorded when you request the post for a specific user.

To track Clicks, an additional step is required. You need to enable click tracking by passing the traceableLinks=true parameter in the API request. This ensures that clicks on links or CTAs within the post are recorded in the analytics.

Note: To track clicks on both the Call to Action (CTA) buttons and Links within the content of your posts, ensure that the links are converted into a traceable format.

When the traceableLinks=true parameter is used in the API request, all links (including CTA and embedded links) will be tracked. If a user clicks on any of these traceable links, the opened URL will be recorded, and a click entry will be logged in your analytics.

We should send the information through the API in JSON format in the request body, as illustrated below:

{ "title": "Title of the post.", 
          "content": "Content of the post.", 
          "contentHtml": "<p>Content of the post.</p>", 
          "language": "EN", "category": "Category", 
          "linkUrl": "https://www.getbeamer.com/", 
          "linkText": "Click here!", 
          "images": [ 
           "https://app.getbeamer.com/pictures?id=123" 
            ] 
         }
Plain text

To track users with views, you should initialize the relevant API to record and retrieve this information.

To ensure that views, unique views, and clicks are correctly tracked, make sure to always pass the user_id parameter in the API request. This allows the system to accurately track and calculate the analytics for each user.