LiveRamp Local Encoder
The LiveRamp Local Encoder allows you to access some of the benefits of LiveRamp Activation or Addressability solutions without having to move your consumer data outside of your control.
Local Encoder enables you to generate securely encoded RampIDs for your consumer data files within your own cloud environment and then utilize that data for activation or addressability use cases, depending on your needs. In this way, your consumer data is never exposed to an external network, while still enabling full use of the LiveRamp solutions. The encoded RampIDs produced by the application cannot be decoded back to the original consumer identifiers.
Depending on your needs, the Local Encoder has several RampID output options that determine how the Local Encoder generates your output file:
RampID packets: Used for Activation by brands and marketers, these RampID packets can be delivered to LiveRamp, where they can be transformed into RampIDs and used to generate fields and segments in your LiveRamp application.
Identity envelopes: Typically used by publishers and platforms that want to get RampIDs into the bidstream to safely engage with the programmatic advertising ecosystem.
Note
Identity envelope output is only available with Local Encoder Version 1.6 or later.
RampIDs: Typically used by publishers and platforms that want to create a RampID mapping.
See the diagrams below for the differences between LiveRamp-hosted ID creation and Local Encoder ID creation (RampID packet example shown).


Local Encoder is run as a Docker image, distributed via the AWS Elastic Container Registry. Local Encoder can be run on any infrastructure that supports running Docker images. Contact your LiveRamp representative to see if the Local Encoder is suitable for your needs.
For additional details, see the sections below. Once you're ready to deploy the Local Encoder, see the following articles for more information:
Regional Environments (EU and US)
LiveRamp supports separate EU and US environments for Local Encoder-related services. Environment assignment depends on the scope of data being processed. Customers processing solely US data should be provisioned to the US environment. Customers processing global, EU, or other multi-region data should use the EU environment. If a customer initially provisioned for US-only processing later needs to process non-US data, LiveRamp will coordinate migration to the EU environment.
Local Encoder continues to process customer data inside the customer’s own cloud environment and raw PII is not sent to LiveRamp.
Local Encoder Security
No matter which method you use to implement the Local Encoder, the security protocols listed below apply.
Local Encoder is distributed as a Docker image. You obtain the Docker image from LiveRamp’s AWS ECR repository.
The application will need read-only access to an input location and write access to an output location. The input location is owned and controlled by you, and the output location is either owned by you or by the LiveRamp platform.
LiveRamp manages the keys and secrets. The application has read-only access to these resources.
The only network calls made are to cloud key management services.
Using Local Encoder for Activation
Brands or marketers can use Local Encoder to get their consumer data into LiveRamp for activation at destination platforms without having that consumer data leave their environment.
For example, you might be a brand with CRM data that wants to send that data to destination platforms for targeting, but not allow your consumer PII to leave your control. You can use Local Encoder to generate RampID packets containing derived RampIDs from your data files, which LiveRamp first ingests into your Connect or Safe Haven account and then uses to create segments from that data. You can then use your LiveRamp application to distribute those segments to your desired destinations, where they’ll be available for activation.
Note
For Activation use cases, you can receive RampID packets. You cannot receive RampIDs or identity envelopes.
Using Local Encoder for Addressability
Platforms and publishers can use Local Encoder to build a mapping between their platform users and RampIDs or identity envelopes without having consumer data leave their environment. This mapping can then be used to allow marketers to use LiveRamp to activate on RampID in their platform for improved matching. This mapping can also be used to transact on RampIDs (by means of identity envelopes) in the bidstream.
For example, you might be a platform that wants to transact on RampIDs in the bidstream with SSPs but not allow your consumer PII to leave your environment. You can use Local Encoder to generate identity envelopes (which contain derived RampIDs). These envelopes can then be used to create a mapping between your platform users and their envelopes. When a mapped user visits your website, you can pass their associated envelope into the bidstream, where they are utilized by SSPs in bid requests.
Note
For Addressability use cases, you can receive RampIDs or identity envelopes. You cannot receive RampID packets.
Deconfliction Options
Deconfliction refers to an optional identity resolution configuration that optimizes the fit of the LiveRamp graph to your definition of a customer, which is particularly beneficial for universe datasets.
Deconfliction attempts to reduce the number of "conflicting" RampIDs for each individual record in a universe dataset. A RampID is considered conflicting if the same RampID is linked to the record for another user (such as a family member) in your system. Deconfliction attempts to include only the RampIDs that are most relevant to an individual record and reduce the number of "shared" RampIDs.
To use deconfliction in Local Encoder, you'll need to provide a record ID (AKA "row ID" or "RID") for each record, and for the configuration to drive the highest value, the full universe is required to deconflict across the table. The output you receive will include the best fidelity RampIDs for each record ID.
There are two deconfliction options you can choose from:
Maximized first-party fidelity: This configuration returns the RampIDs that are determined to be most relevant, but preserves additional record IDs even if there are RampIDs that indicate LiveRamp could consolidate them. This option is ideal for publishers and other data owners.
Standard: This configuration returns the RampIDs that are determined to be most relevant and removes record IDs that are determined to be duplicates (based on linking to the same RampID). This is the default option and covers most advertiser use cases.
To learn more about deconfliction, see "Using Deconfliction on a Universe Dataset". To have deconfliction enabled for your account, contact your LiveRamp representative.
Available Integrations
If you’re using Local Encoder to generate identity envelopes, you can integrate Local Encoder with our Direct to Publisher and Google PAIR programs. This allows you to use Local Encoder to add the associated ID for these programs into the prebid module.
To find out about enabling these integrations, contact your LiveRamp representative.
Integrating with Direct to Publisher
Direct to Publisher enables direct media buys between publishers using ATS and marketers distributing their segments via LiveRamp Connect. Direct to Publisher uses envelopes from ATS to find matching segments. Matched users will be associated with a Deal ID, which will be returned with the ATS envelope back to the user’s browser. Deal IDs for matched users will be used by the Google Publisher Tag (GPT) to communicate with Google Ad Manager (GAM) to present the user with the predefined ad creative.
Note
LiveRamp's Direct to Publisher solution was formerly known as "ATS Direct".
You can integrate Local Encoder envelope generation with our Direct to Publisher program by setting up the ATS API. Once enabled, ATS will return an identity envelope and the IDs needed for Direct to Publisher when refreshing the envelope using the ATS API refresh endpoint.
For more information, see “Direct to Publisher (Publisher Workflow)”.
Integrating with Google PAIR
LiveRamp’s Google PAIR program is a first-party data solution that allows Display & Video 360 publishers and advertisers to match their respective first-party data in a privacy-compliant way.
You can integrate Local Encoder envelope generation with our Google PAIR program by setting up an ATS for API configuration. Once enabled, ATS will return an identity envelope and a PAIR ID when refreshing the envelope using the ATS API refresh endpoint.
For more information, see “Google PAIR and ATS”.
Refreshing Identity Envelopes
If you’re using Local Encoder to obtain identity envelopes, you’ll need to refresh those envelopes periodically, An envelope is valid for 15 days from the date of creation.
A timestamp column is appended to the end of each row. This column gives the expiration date and time for the identity envelope in Unix format (time zone UTC). You can use this timestamp column to determine when you need to refresh the envelope.
You can refresh envelopes by calling the Refreshing Envelopes endpoint of the ATS API (for more information, see “Authenticated Traffic Solution API Documentation”).
Note
Envelopes are also refreshed any time you reprocess the data through the Local Encoder.
How Local Encoder Works
Once you have the Local Encoder configured, the typical workflow consists of these overall steps:
You format your consumer data file(s) and then upload them to the input location of your secure VPC (virtual private cloud).
You run the encoding operation within your VPC:
The data is normalized, and hygiene is performed.
The identifiers in the data are converted into derived RampIDs.
If appropriate, the derived RampIDs for each record are encoded into secure RampID packets or identity envelopes.
The input identifiers are removed and replaced with the appropriate RampID output type (RampIDs, RampID packets, or identity envelopes).
For Activation use cases, the following steps are performed:
The output containing RampID packets is delivered to LiveRamp.
LiveRamp decodes the RampID packets into their individual derived RampIDs.
LiveRamp matches those derived RampIDs to their associated maintained RampIDs.
LiveRamp creates the appropriate fields and segments from the segment data in your LiveRamp platform (such as Connect or Safe Haven).
For addressability use cases, the following steps are performed:
The output containing RampIDs or identity envelopes is sent to the destination of your choice.
You leverage the output to build a mapping table of your customer IDs to RampIDs or identity envelopes.
See the diagram below for an overview of the Local Encoder workflow.

Optimizing Local Encoder
Use the information below to optimize the performance of Local Encoder.
Allocate Sufficient Resources
The application operates entirely in memory, so make sure to allocate sufficient resources to the container to handle the data processing. During processing, the file size increases to 10 times its original size (the recommended initial file size is 500MB or smaller).
Set an Appropriate Transfer Speed
The application starts processing the file immediately as it streams from the input bucket. A transfer speed of 10 Gbps is recommended for optimal performance.
Allocate the Appropriate Number of CPUs
Starting from version 1.8.0, the application supports parallel processing. It will process one file per available CPU, so if you want the application to be able to process 10 files at a time you should allocate 10 CPUs. This should be considered when configuring your infrastructure resources.
When you run the application, you can use the ActiveProcessorCount parameter to specify the number of CPUs that will be utilized. See the individual implementation articles for more information.
Adjust File Sizes
If you want to reduce the processing time, you can partition your files. For example, a single file containing 21 million email addresses will typically be processed in 45 minutes. If you divide those records into two files of 10.5 million records each and have at least 2 CPUs allocated, the processing time will typically be 22.5 minutes.
Note
These typical processing times are estimates based on internal testing. Your processing times might be different.
For optimal performance, we recommend keeping individual input files ≤ 8 GB. Larger files are supported but may impact processing time and resource utilization.
Configure Parallel Processing
To improve the processing of large datasets, you can enable horizontal scaling, which processes files in parallel across multiple Local Encoder containers. For information, see "Enable Horizontal Scaling to Process Files in Parallel".
Adjust the Input Bucket Polling Interval
You can increase the polling interval for the input bucket to reduce AWS S3 or GCS ListBucket API calls and their associated costs. For information, see "Adjust the Input Bucket Polling Interval".
Skip Previously-Processed Input Files
You can configure Local Encoder to automatically skip input files that have already been processed. For more information, see "Skip Previously-Processed Input Files".
Identifiers Local Encoder Supports
The Local Encoder process starts when you upload a column-based file containing your customer records to an input location that you own and control. Each row of the file should contain the identifiers you want to have translated into your desired output. For Activation use cases, you can also include segment data, which will be used to create fields and segments in your LiveRamp platform.
Supported identifier for resolution to RampIDs:
Email addresses: Plaintext or SHA-256 hashed.
Phone Numbers (mobile and landline): Plaintext or SHA-256 hashed.
Note
Hashed phone numbers are not supported for EU or UK records.
Name and postcode: Plaintext only. Requires the following elements for matching:
Note
If any of the required elements are missing, the other name and postcode elements will not be used in matching.
Name and postcode is supported for EU and UK records only.
First name
Last name
Postcode/ZIP Code
Mobile device IDs (MAIDs): Plaintext or SHA-1 hashed AAIDs and IDFAs.
IMEI numbers: Plaintext only.
Note
Name and postcode, mobile device ID, and IMEI are not supported for Addressability use cases. They are only supported for Activation use cases.
Other columns you can include:
Row IDs (RIDs)
Note
The RID (Row ID) column values should be unique across the file. If you need to maintain duplicate RID values, those values should be included in an ATTRIBUTE_1 … N column instead of a Row IDs column.
Segment data (for Activation use cases)
Country code: A column to include when you need to specify the country for each record in a file, as opposed to all records in the file. The column should contain the two-letter country code for each record. For more information, see the “Specifying the Country for the Data” section below.
Example Header
See the header shown below for an example of what the header might look like when sending data in a pipe-separated file (psv) for an Activation use case, where segment data fields are included:
RID|EMAIL1|EMAIL2|EMAIL3|SHA256EMAIL1|SHA256EMAIL2|SHA256EMAIL3|MOBILE1|MOBILE2|SHA256MOBILE1|SHA256MOBILE2|LANDLINE1|SHA256LANDLINE1|FIRSTNAME|LASTNAME|POSTCODE|AAID|SHA1AAID|IDFA|SHA1IDFA|IMEI|COUNTRY_CODE|ATTRIBUTE_1|...|ATTRIBUTE_N
Replace ATTRIBUTE_1 … N in the example header with the name of your CRM attributes.
Formatting and Hashing Identifiers
Local Encoder normalizes and performs hygiene on every plaintext identifier before it converts it into a derived RampID. Hashed identifiers cannot be normalized after hashing, so you must normalize them before hashing as described in the sections below. A hash created from an unnormalized value produces a different hash and cannot be resolved to a RampID.
Follow these guidelines for all identifier types:
Encode as UTF-8: Save input files as UTF-8 and UTF-8 encode every string before hashing it.
One value per column: Put each identifier in its own column, using the headers shown in the "Example Header" section above. To send several values of the same type for one person, use numbered headers (such as EMAIL1, EMAIL2, and EMAIL3) on the same row.
Name hashed columns by hash type: Hashed values should be put in their own columns, with the hash type in the column header(for example, SHA256EMAIL1, not EMAIL1).
Send hashes as hexadecimal strings: A SHA-256 hash is 64 hexadecimal characters. A SHA-1 hash is 40 hexadecimal characters. Do not Base64-encode hashes or add a "0x" prefix.
Do not mix identifier formats in one column: Do not put a plaintext value in a hashed column or a hashed value in a plaintext column.
For more formatting information, see the summary below or the sections for each identifier type.
Summary of Identifier Formatting
Identifier | Supported Formats | Headers to Use | Normalization Steps Before Hashing | Supported Use Cases |
|---|---|---|---|---|
Email address |
|
|
|
|
Phone number |
|
|
|
|
Name and postcode (EU and UK records only) |
|
| N/A |
|
Mobile device ID |
|
|
|
|
IMEI |
| IMEI | N/A | Activation (RampID packets) |
Formatting Email Addresses
Local Encoder supports plaintext email addresses and SHA-256 hashed email addresses. You can include up to three plaintext email addresses and three hashed email addresses per person, each in its own numbered column on the same row.
Formatting Plaintext Email Addresses
Send plaintext email addresses in EMAIL columns (EMAIL1, EMAIL2, and EMAIL3). Local Encoder normalizes each email address before resolving it to a derived RampID.
Formatting SHA-256 Hashed Email Addresses
Send SHA-256 hashed email addresses in SHA256EMAIL columns (SHA256EMAIL1, SHA256EMAIL2, and so on). Before hashing, perform the steps listed below to normalize each email address:
Convert all characters to lowercase.
Remove all whitespace, including leading, trailing, and internal spaces, tabs, and line breaks.
Perform UTF-8 encoding on the string.
Hash the string with SHA-256 and output the hash as a lowercase hexadecimal string.
Note
Local Encoder supports only SHA-256 hashing for email addresses.
Do not apply any other changes before hashing. For example, keep periods and "+" tags in non-Gmail addresses such as Yahoo or Hotmail ("john.smith+news@yahoo.com" stays as is). For Gmail addresses, see the note at the end of this section. Additional changes produce a hash that will not match the same email address sent by other LiveRamp partners.
For example, "John.smith+News@yahoo.com" becomes "john.smith+news@yahoo.com", which hashes to:
f19ce6f9d749b284dfb820e748feee9ed31c73898d5d7dd89c405ed5839bc800
Example in Python 3:
import hashlib
input_email = "John.smith+News@yahoo.com"
normalized = "".join(input_email.lower().split())
local, domain = normalized.split("@", 1)
if domain == "gmail.com": # Gmail only
local = local.split("+", 1)[0] # remove "+" tag
local = local.replace(".", "") # remove dots
normalized = local + "@" + domain
sha256_email = hashlib.sha256(normalized.encode("utf-8")).hexdigest()
# f19ce6f9d749b284dfb820e748feee9ed31c73898d5d7dd89c405ed5839bc800Note
For Gmail addresses (@gmail.com) only, we recommend hashing the tagless, dotless form: After the steps above, remove the "+" tag (the "+" and everything after it, up to the "@") and all periods before the "@". For example, "John.Smith+News@Gmail.com" becomes "johnsmith@gmail.com", which hashes to:
3586de92bb3636d0885a12eff961429a32e4ebd764b96f50d85d016f9338d586
Formatting Phone Numbers
Local Encoder supports plaintext phone numbers and SHA-256 hashed phone numbers. You can include up to three phone numbers (two mobile and one landline) per person, each in its own distinctly labeled column on the same row (for example, MOBILE1, MOBILE2, and LANDLINE1).
Caution
EU and UK records cannot contain hashed phone numbers. Email addresses are the only identifiers that can be hashed in EU or UK records.
Local Encoder applies phone number formatting rules according to the country of each record. Specify the country according to the instructions in the “Specifying the Country for the Data” section below
Formatting Plaintext Phone Numbers in US Records
Send plaintext phone numbers in MOBILE or LANDLINE columns, depending on the type of phone number. Local Encoder removes formatting characters and normalizes each phone number before resolving it to a derived RampID. For US records, use one of these formats:
+1XXXXXXXXXX
+1 (XXX) XXX-XXXX
(XXX) XXX-XXXX
XXX-XXX-XXXX
XXX XXX XXXX
XXXXXXXXXX
Formatting Plaintext Phone Numbers in EU and UK Records
For EU and UK records, send phone numbers in plaintext only. You can send them in international format (for example, +33 6 12 34 56 78 or 0033 6 12 34 56 78) or in national format (06 12 34 56 78).
Local Encoder converts each number to an international format without the "+". For example, the national number "06 12 34 56 78" in a file whose country code is 33 becomes "33612345678".
Do not include the national trunk prefix “(0)” after the country code. For example, send +44 7911 123456, not +44 (0)7911 123456. Numbers that include it may be rejected as invalid or formatted incorrectly, and will not resolve.
Formatting SHA-256 Hashed Phone Numbers in US Records
SHA-256 hashed phone numbers are supported for US records and Activation use cases only. They currently resolve only to maintained RampIDs (see the note at the end of this subsection). Send them in SHA256MOBILE or SHA256LANDLINE columns. Before hashing, perform the following steps to normalize each number to E.164 international standard:
Remove all spaces, parentheses, hyphens, periods, and other non-digit characters.
If the result has 10 digits, add the US country code "1" in front. Then add a "+" in front to get the E.164 format +1XXXXXXXXXX (for example, "+15551234567").
Perform UTF-8 encoding on the string.
Hash the string with SHA-256 and output the hash as a lowercase hexadecimal string.
For example, "+1 (555) 123-4567" becomes "+15551234567", which hashes to:
8a59780bb8cd2ba022bfa5ba2ea3b6e07af17a7d8b30c1f9b3390e36f69019e4
Example in Python 3:
import hashlib
import re
input_phone = "+1 (555) 123-4567"
digits = re.sub(r"\D", "", input_phone)
if len(digits) == 10:
digits = "1" + digits # add US country code
e164_phone = "+" + digits # E.164: +1XXXXXXXXXX
sha256_phone = hashlib.sha256(e164_phone.encode("utf-8")).hexdigest()
# 8a59780bb8cd2ba022bfa5ba2ea3b6e07af17a7d8b30c1f9b3390e36f69019e4Note
Local Encoder accepts only E.164 normalized SHA-256 for hashed phone numbers. Do not send SHA-1 or MD5 hashed phone numbers in SHA256 columns. Do not hash the 10-digit format that LiveRamp Connect uses for SHA-1 hashed phone numbers as those hashes will not resolve to a RampID.
Caution
EU and UK records cannot contain hashed phone numbers.
SHA-256 hashed phone numbers are supported for Activation use cases only and currently resolve to maintained RampIDs.
RampID packets are delivered to LiveRamp, matched to maintained RampIDs, and distributed to your destinations.
The derived RampIDs that Local Encoder generates from SHA-256 hashed phone numbers will not match the derived RampIDs that other platforms or brands generate from plaintext or SHA-1 hashed phone numbers.
SHA-256 hashed phone numbers are not supported for Addressability use cases (RampIDs or identity envelopes). For those use cases, send plaintext phone numbers.
Formatting Name and Postcode (EU and UK Records Only)
Local Encoder accepts plaintext name and postcode for EU and UK records only, and only for Activation use cases. Name and postcode cannot be hashed because there is too much variation in casing, spacing, and accented characters to hash them reliably.
For this identifier type, you must include each element listed in the table below in its own column. If your file includes only some of these columns, Local Encoder ignores those columns and does not resolve them to a RampID.
Element | Header | Notes |
|---|---|---|
First name | FIRSTNAME |
|
Last name | LASTNAME |
|
Postcode or ZIP Code | POSTCODE |
|
In addition to the specific guidelines shown above, follow these overall formatting guidelines for names and postcodes:
Send names and postcodes in plaintext, UTF-8 encoded. Send the values as they appear in your records. You don't need to remove accents or spaces or change the case.
Do not combine first and last names in a single column.
Do not include line breaks within a value. This often happens when data is exported from a spreadsheet with two lines in one cell.
Include one name and postcode combination per row. If you have more than one postcode for the same person, put each on a separate row with the same FIRSTNAME and LASTNAME values.
Before resolving these identifiers to a derived RampID, Local Encoder removes spaces and accents and converts the values to lowercase. For example, "Hélène" becomes "helene" and "SW1A 1AA" becomes "sw1a1aa".
Formatting Mobile Device IDs
Local Encoder supports plaintext and SHA-1 hashed mobile device IDs (MAIDs) for Activation use cases only:
IDFA (Identifier for Advertisers): Apple iOS devices.
AAID (Android Advertising ID): Android devices.
Note
SHA-1 hashed mobile device IDs are supported for US records only. EU and UK records cannot contain hashed mobile device IDs.
Format each MAID as a 36-character UUID with hyphens in the standard 8-4-4-4-12 pattern, for example:
1f4d256c-1f08-41f6-a108-bbe511de9497
Follow these guidelines:
Do not remove the hyphens or add braces, quotes, or prefixes.
You can send plaintext MAIDs in uppercase or lowercase. Local Encoder converts plaintext AAIDs to lowercase and plaintext IDFAs to uppercase before processing.
Do not send zeroed-out IDs ("00000000-0000-0000-0000-000000000000"), which devices report when the user has limited ad tracking. Leave the cell empty instead.
You can include both IDFAs and AAIDs in the same file.
Formatting SHA-1 Hashed Mobile Device IDs
SHA-1 hashed mobile device IDs are supported for US data only. Send them in SHA1IDFA or SHA1AAID columns. Before hashing, perform the following steps to normalize each ID:
Make sure the ID is a 36-character UUID in the 8-4-4-4-12 pattern. Keep the hyphens.
Convert AAIDs to lowercase and IDFAs to uppercase.
Perform UTF-8 encoding on the string.
Hash the string with SHA-1 and output the hash as a lowercase hexadecimal string (40 characters).
Local Encoder cannot correct the case of a MAID after it's hashed, so step 2 is required for hashed IDs. For example, the AAID "1f4d256c-1f08-41f6-a108-bbe511de9497" hashes to:
2160f226e4b9f3e05f78b2b550b19d5f7a2a017b
The same value as an IDFA, "1F4D256C-1F08-41F6-A108-BBE511DE9497", hashes to:
ec640d40d25a4c436e0909810fe77daae2e6494c
Example in Python 3:
import hashlib
aaid = "1F4D256C-1F08-41F6-A108-BBE511DE9497"
idfa = "1f4d256c-1f08-41f6-a108-bbe511de9497"
sha1_aaid = hashlib.sha1(aaid.strip().lower().encode("utf-8")).hexdigest()
sha1_idfa = hashlib.sha1(idfa.strip().upper().encode("utf-8")).hexdigest()
# sha1_aaid: 2160f226e4b9f3e05f78b2b550b19d5f7a2a017b
# sha1_idfa: ec640d40d25a4c436e0909810fe77daae2e6494cNote
Local Encoder accepts only SHA-1 for hashed mobile device IDs.
Caution
EU and UK records cannot contain hashed mobile device IDs. Email addresses are the only identifiers that can be hashed in EU records.
Formatting IMEI Numbers
Local Encoder supports plaintext IMEI (International Mobile Equipment Identity) numbers for Activation use cases only. For Activation, IMEIs are resolved to derived RampIDs and included in RampID packets. IMEIs are not supported for Addressability use cases, so they do not return RampIDs or identity envelopes.
Send IMEIs in the IMEI column. Format each IMEI as exactly 15 digits, for example:
490154203237518
Specifying the Country for the Data
When your Local Encoder application is configured, a default country is set in the locale setting of the configuration (.yaml) file included with your Local Encoder package. As long as all the data you send is from that default country, you do not need to specify the country in the file or the file name.
To process data from different countries than your default country, you will need to use one of the two options shown below to specify the country for each record:
Files with records from a single country: When processing a file where all of the records are from a single country, you can add the two-letter country code for the country in the file name in the format “<filename>_<country code>.<extension>”. The code in the file name will take priority over the default setting. Local Encoder adds the country code to the output file name, so you do not need to add it yourself (the output file name will follow the format “<filename>_<country code>.<extension>”).
Files with records from several countries: If the multi-matching flow has been configured for your account, you can send a single file containing records from multiple countries:
Include a COUNTRY_CODE column that contains the two-letter country code for each row.
Caution
If the multi-matching flow is not configured for your account, do not include a country code column. The entire file will be processed against the single country configured as the default country or specified in the file name.
Do not leave any country code cell empty, as a row with an empty country code will cause the file to fail.
Set the LR_VAULT_COUNTRY_CODE_COLUMN environment variable in your .yaml configuration file to the name of your country code column (such as “COUNTRY_CODE”) when you configure Local Encoder.
Note
Once that environmental variable is set, every file Local Encoder processes must include that column.
Local Encoder then formats each phone number using that row’s country, so one file can contain records from multiple countries.
Note
When including country codes in file names or in a country code column, use the two-letter ISO 3166-1 alpha-2 code in uppercase (for example, “US”, “GB”, or “FR”). For the United Kingdom, use “GB”, not “UK”.
Caution
If the country does not match the phone numbers in the file (for example, GB phone numbers processed with a country of US), Local Encoder does not return an error. The phone numbers are formatted according to the specified country’s rules and will not resolve to a RampID.
Output Options and Examples
See the sections below for more information on the output options for Local Encoder and output file examples.
RampIDs
RampIDs are LiveRamp’s proprietary, pseudonymous identifiers for representing individuals. RampID creation involves hashing, salting, and private key encryption in order to prevent consumer data from being re-identified. RampIDs are unique for each LiveRamp client and have a partner-specific encoding.
RampIDs form the basis for using the LiveRamp product. Once your data has been converted to RampIDs, you are able to use the LiveRamp platform for collaboration, activation, and measurement activities.
For RampID output, all consumer identifier data in a row is transformed into derived RampIDs in the form of a JSON string in a "RampID" column:
Each plaintext email address returns a derived RampID for each hash type (MD5, SHA1, and SHA-256)
Each SHA-256 hashed email address returns one derived RampID
Each phone number returns one derived RampID
See below for an example of an output file for RampID output, based on the input file shown below:
RID|EMAIL1|MOBILE1 123|solomon@mac.com|(629) 555-1536 456|maratb@gmail.com|(365) 555-0786
The output file will follow the format shown below:
RID|RampID
The JSON string might look like the example below:
RID, [
{
"header": "EMAIL1",
"RampID": {
"MD5": "Xi2247b9-ap-AcsWdsKFquY8vUnNig7fYQC-zkiqN9MKJQLvXaq_dppPrOiQBIy8PUYN2h",
"SHA1": "Xi2247LbvDme7s-hRJXnG1NXe6CwFpRlNC60vFHOOpQXROEBiSF0LZYmdGYcbMcechi_iL",
"SHA256": "Xi2247FbP--uJe0dFhLUrVD1MOTO6Iuncg5XbBOrR3MFywWgJMP9gzt2pdnVfCWQiUo-d_"
}
},
{
"header": "MOBILE1",
"RampID": {
"NONE": "Xi2247zPBI2V6OAVfpzBWhKy3ay8WJ66flt_1_hDYr0-y3mcf1HHDt2ZgRTyvhWxqp08Y0"
}
}
]RampID Packets
For Activation use cases, Local Encoder can generate RampID packets by bundling individual RampIDs for a given consumer record and then adding an additional layer of encryption that involves a randomly-generated code. The randomly-generated code provides an added layer of protection, ensuring that the same client record (with the same RampID) will produce a packet that looks different every time the application runs.
The packets produced by the application are sent to LiveRamp, where they are unpacked and the included RampIDs are loaded into the client’s LiveRamp account.
For RampID packet output, all consumer identifier data in a row is transformed into derived RampIDs, packaged into one data structure, and encrypted again, yielding a RampID packet.
See below for an example of an output file for RampID packet output, based on the input file shown below:
RID|EMAIL1|MOBILE1|FIRSTNAME|LASTNAME|POSTCODE|DOG_OWNER|NUM_DOGS 123|solomon@mac.com|(629) 555-1536|Solomon|Gumbel|10012|true|3 456|maratb@gmail.com|(365) 555-0786|Marta|Baldwin|94602|false|0
The output file will follow the format shown below:
RID|RampID_PACKET|DOG_OWNER|NUM_DOGS 123|dVd8HezBpkyxiOpiUwh1+iYBBRx+RrBMM02rnvDoZT8i=|true|3 456|Tt16SRP6Svrnc2CQPrnHsLEcDR+WWLscjWdYmY2JR5h=|false|0
Identity Envelopes
Identity envelopes are typically utilized by publishers and platforms who want to get RampIDs into the bidstream to safely engage with the programmatic advertising ecosystem or who want to enable brands and marketers using LiveRamp to distribute RampID-based data for improved targeting.
Note
Identity envelope output is only available with Local Encoder Version 1.6 or later.
An identity envelope is an opaque and encrypted structure containing RampIDs and metadata. Each envelope is created with a client-specific encryption key that makes it unique. An envelope is valid for 15 days from the date of creation (the output file contains the expiration date and time for each envelope).
Note
To refresh expired envelopes, use the Refreshing Envelopes endpoint of the ATS API (for more information, see “Authenticated Traffic Solution API Documentation”).
For identity envelope output, all consumer identifier data is transformed into derived RampIDs. A selection logic is applied, and then the RampID is additionally obfuscated and encrypted into an identity envelope. Only one identity envelope is returned per row of data.
A timestamp column is appended to the end of each row. This column gives the expiration date and time for the identity envelope in Unix format (time zone UTC). You can use this timestamp column to determine when you need to refresh the envelope.
An envelope is represented as a Base64-encoded string.
Identity envelope string example:
AY3SYJlFDI1RqsMv9gZOjOab6hGuwWKmbE4K70Z-Zex27DD6M9U0Jg
The string is different each time an envelope is created for the same underlying data as a result of randomization.
Envelopes can be decrypted using the Envelope Decryption API or by SSPs running the Sidecar application.
See below for an example of an output file for identity envelope output, based on the input file shown below:
RID|EMAIL1|MOBILE1 123|solomon@mac.com|(629) 555-1536 456|maratb@gmail.com|(365) 555-0786
The output file will follow the format shown below:
RID|ENVELOPE|TIMESTAMP 123|AY3SYJlFDI1RqsMv9gZOjOab6hGuwWKmbE4K70Z-Zex27DD6M9U0Jg|1701715163 456|ApKVQQBzOR41WDJQoK_iWEaJNsvVUcOHgOWEwB_SzNSRvHPNegb8-EpxIu3G-1ikxzGUwJZQcHOZLsZLySU|1701715163
Supported Input/Output Combinations
Local Encoder supports 12 input/output combinations: 3 input sources and 4 output destinations:
Input Sources
Local Folder: Files on local filesystem
AWS S3 (Client): Customer's S3 bucket (prefix: s3://)
Google Cloud Storage: GCS bucket (prefix: gs://)
Output Destinations
Local Folder: Files written to local filesystem
S3 Client (Customer S3): Customer's S3 bucket (prefix: s3://)
S3 LR (LiveRamp S3): LiveRamp's S3 bucket (prefix: s3lr://)
Google Cloud Storage: GCS bucket (prefix: gs://)
Complete I/O Combinations
Input Source | Output Destination | Profile | Skip Detection |
|---|---|---|---|
Local | Local | localInput + localOutput | Scans local output directory |
Local | S3 Client | localInput + s3ClientOutput | Lists S3 Client bucket objects |
Local | S3 LR | localInput + s3LrOutput | Lists S3 LR bucket objects |
Local | GCS | localInput + gcsOutput | Lists GCS bucket blobs |
S3 Client | Local | s3Input + localOutput | Scans local output directory |
S3 Client | S3 Client | s3Input + s3ClientOutput | Lists S3 Client output bucket |
S3 Client | S3 LR | s3Input + s3LrOutput | Lists S3 LR output bucket |
S3 Client | GCS | s3Input + gcsOutput | Lists GCS output bucket |
GCS | Local | gcsInput + localOutput | Scans local output directory |
GCS | S3 Client | gcsInput + s3ClientOutput | Lists S3 Client bucket objects |
GCS | S3 LR | gcsInput + s3LrOutput | Lists S3 LR bucket objects |
GCS | GCS | gcsInput + gcsOutput | Lists GCS output bucket |
Input/Output Configuration Examples
Combination | LR_VAULT_INPUT | LR_VAULT_OUTPUT |
|---|---|---|
Local → Local | /data/input | /data/output |
Local → S3 Client | /data/input | s3://customer-bucket |
Local → S3 LR | /data/input | s3lr://liveramp-bucket |
Local → GCS | /data/input | gs://gcs-bucket |
S3 → Local | s3://input-bucket | /data/output |
S3 → S3 Client | s3://input-bucket | s3://output-bucket |
S3 → S3 LR | s3://input-bucket | s3lr://liveramp-bucket |
S3 → GCS | s3://input-bucket | gs://output-bucket |
GCS → Local | gs://input-bucket | /data/output |
GCS → S3 Client | gs://input-bucket | s3://customer-bucket |
GCS → S3 LR | gs://input-bucket | s3lr://liveramp-bucket |
GCS → GCS | gs://input-bucket | gs://output-bucket |