Skip to main content

Perform RampID Transcoding in Snowflake

LiveRamp's RampID Transcoding application in Snowflake allows for the translation of one RampID encoding to another using either maintained or derived RampIDs. This allows you to match persistent pseudonymous identifiers to one another and enables use of the data without sharing the sensitive underlying identifiers.

Note

For more information about RampID, see "RampID Methodology".

Specifically, RampID transcoding enables:

  • Data collaboration with trusted partners.

  • Measurement enablement across device types.

  • Direct activation with DSPs or other tech platforms

These capabilities are available within Snowflake through a Native App, which creates a share to your account, opening up a view to query the reference data set from within your own Snowflake environment. See "LiveRamp Embedded Identity in Snowflake" for more information.

Overall Steps

After you've set up the transcoding native app in Snowflake (see "Set Up a Native App" for instructions), perform the following steps to perform RampID transcoding:

  1. Verify that you've performed all the native app setup tasks in the completion checklist.

  2. Prepare the input and metadata tables for transcoding.

  3. Perform transcoding.

See the sections below for information on performing these tasks.

Completion Checklist for Native App Setup

Before performing a transcoding operation for the first time, verify that you've completed the following tasks to set up a transcoding native app in Snowflake:

Note

For instructions on completing these tasks, see "Set Up a Native App".

  • Accepted the terms and conditions of the application.

  • Installed the LiveRamp Snowflake Native Application.

  • Ran the API integration code.

  • Created an external function that the native application can use to call the ID-API for authentication.

  • Created and granted permissions to a role that gives the App Share database access to the customer’s tables.

  • Created logging and metrics tables, added them to a share, and shared that share back to LiveRamp.

After these tasks have been completed, you are ready to prepare the tables and perform the operation. See the sections below for more information.

Prepare the Tables for Transcoding

Interaction with the LiveRamp Native App requires the preparation and deployment of two tables:

  • A metadata table, indicated in the code as <transcoding_meta_table>.

  • An input table, indicated in the code as <SNOWFLAKE_CONSUMER_INPUT_DATABASE>.

    Note

    An input table needs to be prepared for each transcoding operation.

    The tables for transcoding are different than the tables used for device resolution.

To create the input and metadata tables:

  1. Click in the Create input and metadata table procedure.

  2. Click Run.

  3. Make any necessary changes to the variables:

    <SNOWFLAKE_CONSUMER_INPUT_DATABASE>

    <SNOWFLAKE_CONSUMER_SCHEMA>

    <transcoding_input_table>

    <transcoding_meta_table>

You can create these tables inside Snowflake or import the tables into your database using Snowflake’s standard methods. The <...> variables may be substituted with your own values. Be sure to reference the names correctly in the metadata table, which has as its default name <transcoding_meta_table>, and that the column names also match up correctly.

When creating tables, keep the following guidelines in mind (in addition to the guidelines listed in the sections below):

  • Every column name must be unique in a table.

  • Try not to use additional columns in the tables required for the transcode operation. Having extra columns slows down processing.

  • The transcode operation can process records containing blank fields.

Table Naming Guidelines

When naming tables, follow these guidelines:

  • Table names must use ASCII characters and not contain either spaces or special characters such as !@#$%.

  • You can use underscores “_” within the name, but not as the initial character.

  • Consider using the following elements in your table names: type of data or description, a date or timestamp, and an identity designation. For example, the table name Identity_TwoButtonSuitsCampaign_impressions_2022-06-01 contains all three element types.

Metadata Table Columns and Descriptions

Metadata column names must match those shown in the reference tables below. The column names are not case sensitive, and should not be enclosed in single or double quotation marks.

Column

Description

CLIENT_ID

Enter either an existing CLIENT_ID or a new one provided in implementation.

CLIENT_SECRET

Password/secret for the CLIENT_ID.

EXECUTION_MODE

Transcoding.

EXECUTION_TYPE

Transcoding.

TARGET_COLUMN

Enter the column name for the input table which contains the IDs to be transcoded.

TARGET_DOMAIN_COLUMN

Enter the target domain the encoding the RampIDs will be translated to.  Example domain: T001.

TARGET_TYPE_COLUMN

RampID.

Note

This column displays the type of identifier to be generated. Currently, only RampID is supported as a TARGET_TYPE_COLUMN.

Table 4. Metadata table columns.


Input Data Table Columns and Descriptions

Column names for client data tables can be user-provided values as long as the names match what is provided in the metadata table.

Column

Sample

Description

RampID (native encoding)

XYT999RkQ3MEY1RUYtNUIyMi00QjJGLUFDNjgtQjQ3QUEwMTNEMTA1CgMjVBMkNEMTktRD

RampID (maintained or derived) for translation.

Target Domain Column

2222

Target domain

ID Type

RampID

Target type, currently only RampID is supported.

Table 5. Client data table columns for transcoding, shared with LiveRamp by the client.


The output table is created by the operation that you run. For an example, see the "Perform Transcoding" section below.

Note

You can transcode both maintained RampIDs and derived RampIDs in your table.

Perform Transcoding

You perform a transcoding operation by running the transcoding procedure and then checking that the output has succeeded. You then open the output table to check the results.

To transcode the input table:

  1. Select the input table in the left-hand Database Objects navigation pane.

  2. Click on the magnifying glass icon tab shown in the figure below.

    Note

    The Input table should contain a RAMPID field, the TARGET_DOMAIN you wish to convert the RampID to, and the TARGET_TYPE which for a transcoding operation should be RAMPID.

    The metadata table should contain fields for: CLIENT_ID, CLIENT_SECRET, EXECUTION_MODE, EXECUTION_TYPE, TARGET_COLUMN, TARGET_DOMAIN_COLUMN, TARGET_TYPE_COLUMN.

    Results of the transcode operation.
    Figure 8. Results of the transcode operation.


    Run the transcoding operation specific for your database and schema to convert your input table ID values using the parameters in the metadata table for conversion to new RampIDs in the output table.

  3. Locate the lr_resolution_and_trancoding procedure shown below and click on that code block.

    call <native_app_database_name>.lr_app_schema.lr_resolution_and_transcoding
    (
        ‘<consumer_database_name>.<consumer_schema_name>.<INPUT_TABLE>’,
        ‘<consumer_database_name>.<consumer_schema_name>.<META_TABLE>’,
        ‘<OUTPUT_TABLE>’,
        ‘<consumer_database_name>.<consumer_schema_name>.<LOGGING_TABLE>’,
        ‘<consumer_database_name>.<consumer_schema_name>.<METRICS_TABLE>’
    );
  4. Ensure that you have correctly entered the names of the database objects you are using into the procedure above.

  5. Click Run.

    The transcode operation runs to completion.

  6. Open the LiveRamp app worksheet.

  7. Locate the Check for output procedure shown below and click in that block.

    // Check for output
    /*
    Check for output
    */
    call <native_app_database_name>.lr_app_schema.check_for_output(	'<OUTPUT_TABLE>',
    );
    /*
    END SECTION
    */
  8. Click Run.

  9. Wait until Snowflake returns a status message of success or error.

    Once the app returns a success message, the output should be displayed in the native app database under lr_app_schema.

The results end up in the output table in the same database, the TRANSCODING_TEST_TABLE shown in the example above (see Step 2).

Column

Sample

Description

RampID (native encoding)

XYT999RkQ3MEY1RUYtNUIyMi00QjJGLUFDNjgtQjQ3QUEwMTNEMTA1CgMjVBMkNEMTktRD

Returns the original RampID sent from the native encoding.

Transcoded_identifier (RampID’s in destination encoding)

XYT001k0MS00MDc1LUI4NjEtMjlCOUI0MUY3MENBCgNjVGQjE0MTMtRkFBMC00QzlELUJF

Transcoded RampID or NULL (NULL due to unreadable native RampID or unauthorized domain, etc.).

Table 6. Output table columns for transcoding.