Developer
User guidesDeveloper websiteHelp centerLog in
  • Welcome!
  • Organisations structure
    • Datamart
    • Users and roles
  • User points
    • User identifiers
      • Networks IDs
        • Device-based Network IDs
          • Custom Device ID integration
          • ID5
          • First ID
        • User-based Network IDs
          • Custom User ID integration
          • UTIQ martechpass
      • Accounts
      • Emails
      • Device identifiers
    • User activities and events
    • Compartments
    • User profiles
    • User segments
    • Hyper point & Quarantine
  • Data model
    • Defining your schema
    • Computed fields
      • Concepts
      • Setup
      • Development
      • Examples
  • Data ingestion
    • Real time user tracking
      • Website tracking
      • Mobile apps tracking
      • Ads exposure tracking
      • AMP tracking
      • Conversions tracking
      • Email views and clicks
      • Tracking API
      • Event rules
      • Activity analyzers
    • Bulk processing
      • Imports
        • User activities import
        • User profiles import
        • User choices import
        • Segments import
      • Deletions
        • User identifiers deletion
        • Device points deletion
        • User points deletion
      • User identifiers association
      • Integration batch
    • Activities analytics
    • Data warehouse
      • Preliminary setup
        • BigQuery
      • Create data warehouse
  • Querying your data
    • OTQL queries
    • OTQL examples
    • GraphQL queries
    • UserPoint API
    • User activities
    • Activities analytics queries
      • API Quickstart
      • Dimensions and metrics
      • Use cases
    • Funnel API
  • Alerting
    • Alert configurations
  • Data visualisation
    • Quickstart
    • Dashboards
    • Sections and cards
    • Charts
    • Datasets and data sources
      • Using a data file data source
    • Transformations
    • Filters
    • Cookbook
    • Reference
  • Advanced usages
    • Audience segmentation
      • Audience features
      • Segment builders
      • Audience segment metrics
      • Audience segment feed
        • Building new feeds
        • Monitoring a feed
        • Curated Audiences (SDA)
      • Edge segments
      • Cohort-based Lookalike
    • Contextual targeting
      • Setup
      • Activation
        • Google Ad Manager
        • Xandr (through prebid.js)
      • API documentation
    • Exporting your data
      • Query Exports
      • Datamart replication
    • Data privacy compliance
      • User choices
      • Cleaning rules
      • Exercise of user rights
      • Cookies
    • Campaigns
    • Automations
      • Email routers
      • Email renderers
      • Opt-in provider
      • Custom action plugins
      • Usage limits for automations
    • Plugins
      • Concepts
      • Creation & Deployment
      • Coding your plugin
      • Manage existing plugins
      • Layouts
      • Presets
      • Monitoring
      • Throttling
      • Batching (for external feeds)
    • Platform monitoring
      • Resources usage
        • Dimensions and metrics
      • Collection volumes
        • Dimensions and metrics
      • Events ingestion monitoring
        • Dimensions and metrics
    • Data Clean Room
      • Bunker
      • Clean room
  • Resources
    • Tutorial: Data Ingestion
      • Your first events
        • Add the mediarithmics tag
          • Getting the tag
          • Adding the tag
        • Send events using the tag
          • Adding event properties
          • Finding the UserEvent type in your schema
          • Matching your schema
          • Standard events
      • Your first bulk imports
        • API basics
          • Authentication
          • Your first API call
        • Send documents using the API
          • Requirements
          • Sending documents
    • Using our API
      • Authentication
    • Tools & libraries
      • mics CLI
      • JS Tag
      • Plugin SDK
    • Data cubes
      • Creating a report
      • Reference
Powered by GitBook
On this page
  • Step 1: Create your computed field function (plugin)
  • Develop the plugin with the SDK and create a build from it
  • Create a plugin and a version
  • Step 2: Create your computed field within the platform
  • Step 3: Declare your computed field in your schema
  • Step 4: Wait until the end of the initial loading
  • Step 5: Use your computed field

Was this helpful?

Export as PDF
  1. Data model
  2. Computed fields

Setup

PreviousConceptsNextDevelopment

Last updated 2 days ago

Was this helpful?

Computed fields are created as of plugin, requiring collaboration with mediarithmics Professional Services (PS) team.

The implementation involves defining the logic, writing plugin specifications, developing the plugin, and configuring the computed fields.

Please discuss your needs with your account manager.

Step 1: Create your computed field function (plugin)

Check the . Bellow are some precisions about specific Computed fields Function implementation.

Develop the plugin with the SDK and create a build from it

You are required to implement 4 key functions from the Plugin SDK.

OnUpdate functions

These 3 functions are triggered during the initialization of the Computed Field Function and whenever a new activity, profile update, or computed field modification occurs, updating the State accordingly.

.

Although onUpdateComputedField has not been released yet, it is still required to be implemented in your plugin. In the meantime, simply return the State directly to avoid any errors.

BuildResult

This function returns the result of the computed field function for a specific State. The Result will be stored for a defined duration, and querying the field will return the stored value during that period.

Create a plugin and a version

Step 2: Create your computed field within the platform

  1. In the Navigator > Settings > Datamart, navigate to Computed Fields.

  2. Add a new computed field.

  3. Select the plugin and version of the new instance you want to use.

  4. Complete the necessary fields:

Fields
Description

Name

Name of the computed field

Description

(Optional) Describe the computed field

Technical name

Name of the computed field used in the schema

Compute period (in days)

Maximal duration before the periodic update of the Result in days.

Events filter

GraphQL selector query to filter the activity which will trigger the State updates

This will set up the computed field linked to your computedfield function for use in the schema.

Step 3: Declare your computed field in your schema

After creating the computed field, you need to connect it to your schema:

  1. Use the directive @ComputedField(technical_name = "...") at the appropriate level of your schema.

  2. Ensure the technical name matches the one used when creating the computed field.

This will integrate the computed field into your schema and make it available for use in queries and operations.

// Example in your schema 
type UserPoint {
  id: ID!
  accounts: [UserAccount]
  …
  rfm_score: RfmScore @ComputedField(technical_name = “RfmScore”) @TreeIndex(index:"USER_INDEX")
}

type RfmScore {
  …
}

A schema validation will be triggered when you click Save. It will ensure that your Datamart has access to all the declared computed fields and verify their integration with the schema.

The computed field must be in the UserPoint object.

Step 4: Wait until the end of the initial loading

Once your schema is validated, our service will run a job to initialize your computed field and set the state to match the current status of the timeline. For each user point in your Datamart, we will process their timeline and execute the OnUpdateXXX() function.

To monitor the progress:

  1. Go to the Computing Console > Computed Fields.

  2. Check if your computed field is ready or if the initial loading is still in progress.

Please note, this process may take some time to complete (up to 72h) as it computes the timelines for all user points.

Avoid using your computed field until the initial loading is complete. While the query will not return an error, the result may be inaccurate during this process.

Step 5: Use your computed field

Once the initial loading is complete, you can start using your computed field just like any other standard field in mediarithmics features.

For example, in query tools or any OTQL query:

SELECT { rfm_score } FROM UserPoint

If your computed field is indexed, you can also perform queries like:

SELECT { id } FROM UserPoint WHERE rfm_score = "PASSIVE"

This allows you to incorporate the computed field into your data analysis and queries once it's fully initialized.

.

Follow the standard procedure to with the type COMPUTED_FIELD_FUNCTION. Once the plugin is created, you can from the build.

following documentation to learn more about Plugin development
Create your computed field function (plugin)
Create your computed field within the platform
Declare your computed field in your schema
Wait until the end of the initial loading
Use your computed field
create a plugin
generate a new version
You can find the list of all the methods to be developed here
You can find all the details about this method here