Skip to main content

Share Data from Snowflake to Your LiveRamp Account

LiveRamp's Embedded Identity is available through Snowflake's Marketplace. Once one of the Identity Resolution functions has been executed and you have data tied to RampID in your Snowflake account, you can share that data to your LiveRamp account so you can use it in LiveRamp's marketer-friendly UI for building segments and distributing to desired destinations.

Note

  • LiveRamp’s Embedded Identity is currently available in the following Snowflake cloud regions:

    • AWS: us-east-1 and us-west-2

    • Azure: eastus2

  • For more information on LiveRamp's Embedded Identity in Snowflake, see this help article.

Once you have been contracted for Snowflake activation, your LiveRamp account representative will set up your access.

Once you’ve received confirmation from your LiveRamp representative that your access has been configured, perform the steps below to share an output table to your LiveRamp account.

Steps to Share Data from Snowflake to LiveRamp

Once your LiveRamp representative has confirmed that your access has been configured, you can share a table from Snowflake to your LiveRamp account by performing the following steps:

Note

  • If your LiveRamp representative has not completed the process to provide you with access, the share will be rejected.

  • For support during the data sharing process, email liverampsnowflakesupport@liveramp.com.

  1. Create a local copy of the Identity output table by running the following commands (after substituting the relevant parameters for the variables shown):

    Note

    Snowflake does not currently allow sharing tables from a shared database directly. Because of this, you will need to create a local copy of the output table you want to share. For more information, see this Snowflake article.

    CREATE OR REPLACE TABLE <customer_db_name>.<customer_schema_name>.<customer_table_name> AS SELECT * FROM native_app_db.lr_job_schema.output_table_name;

    Parameters:

    • <customer_db_name>: The name of the database that contains the schema (and associated table) you would like to share.

    • <customer_schema_name>: The name of the schema where your shared table lives.

    • <customer_table_name>: The name of the table you would like to share. This will be the name of the table asset you will see in the LiveRamp UI.

    For example, let’s say you want to share the table with the parameters listed below:

    • <customer_db_name>: "LIVERAMP_CUSTOMER_DEMO_DB"

    • <customer_schema_name>: "PUBLIC"

    • <customer_table_name>: "COOKIE_OUTPUT_TABLE"

    You would insert those parameters into the variables and run the following commands:

    CREATE OR REPLACE TABLE LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.COOKIE_OUTPUT_TABLE AS SELECT * FROM native_app_db.lr_job_schema.output_table_name;
  2. Share the local copy of the output table to LiveRamp’s Snowflake account by running the following commands (after substituting the relevant parameters for the variables shown):

    Note

    • The share method shown below can only be used to grant access to one database. That database can contain multiple tables.

    • If you want to share a table from an additional database, follow the instructions in the “Share Data from Additional Databases” section below.

    CREATE SHARE IF NOT EXISTS <share_name>;
    
    GRANT USAGE ON DATABASE <customer_db_name> TO SHARE <share_name>;
    GRANT USAGE ON SCHEMA <customer_db_name>.<customer_schema_name> TO SHARE <share_name>;
    GRANT SELECT ON TABLE <customer_db_name>.<customer_schema_name>.<customer_table_name> TO SHARE <share_name>;
    
    ALTER SHARE <share_name>  ADD accounts = <LiveRamp Primary Account ID>;

    Parameters:

    • <share_name>: The name you want to give to the share to your LiveRamp account. The share name only needs to be created once and can be used for all sharing of tables from Snowflake to your LiveRamp account.

    • <customer_db_name>: The name of the database that contains the schema (and associated table) you would like to share.

    • <customer_schema_name>: The name of the schema where your shared table lives.

    • <customer_table_name>: The name of the table you would like to share. This will be the name of the table asset you will see in the LiveRamp UI.

    • <LiveRamp Primary Account ID>: The LiveRamp Primary Account ID (LPA ID) for LiveRamp’s Snowflake seat for the appropriate cloud provider and region:

      • For AWS us-east-1, use "HAA77632"

      • For AWS us-west-2, use "LFB47396"

      • For Azure eastus2, use "ZP11254"

    For example, let’s say you want to share the table with the parameters listed below:

    • <share_name>: "TEST_SHARE"

    • <customer_db_name>: "LIVERAMP_CUSTOMER_DEMO_DB"

    • <customer_schema_name>: "PUBLIC"

    • <customer_table_name>: "COOKIE_OUTPUT_TABLE"

    You would insert those parameters into the variables and run the following commands:

    CREATE SHARE IF NOT EXISTS TEST_SHARE;
    ALTER SHARE TEST_SHARE  ADD accounts = HAA77632;
    
    GRANT USAGE ON DATABASE LIVERAMP_CUSTOMER_DEMO_DB TO SHARE TEST_SHARE;
    GRANT USAGE ON SCHEMA LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC TO SHARE TEST_SHARE;
    GRANT SELECT ON TABLE LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.COOKIE_OUTPUT_TABLE TO SHARE TEST_SHARE;

    Note

    • Lines 1 and 2 only need to be run once to create the connection to LiveRamp.

    • If you want to share an additional table from the same schema, you only need to run line 6 with the new table name.

    • If you want to share an additional table from a different schema, you only need to run lines 5 and 6 with the new schema name and new table name.

    • If you want to share a table from a different database, follow the instructions in the "Share Data from Additional Databases" section below.

  3. If this is the first share you're sending, contact your LiveRamp representative to give them the share name you used in the previous step.

    Once the share has been configured and received into your LiveRamp account, the table will be available in the LiveRamp UI for segment building (typically within 10 minutes if the share name has already been configured). You can view your tables on the All Assets page in the LiveRamp UI.

    Note

    • If you update an output table in Snowflake that you've shared, the table in your LiveRamp account will also get updated. If you've created any segments from that table in your LiveRamp account, those segments will also get updated.

    • We do not currently support deletion of tables in the LiveRamp UI or revoking of shares, but plan to provide these features in the future.

Share Data from Additional Databases

If you want to share table data from a different database than the one specified initially, run the following commands to create a view of that table and then share it:

CREATE SECURE VIEW <view_name> AS SELECT * FROM <database2.public.sampletable>;

GRANT USAGE ON DATABASE <database1> TO SHARE <share1>;

GRANT USAGE ON SCHEMA <database1.schema1> TO SHARE <share1>;

GRANT REFERENCE_USAGE ON DATABASE <database2> TO SHARE <share1>;

GRANT SELECT ON VIEW <view_name> TO SHARE <share1>;

Parameters:

  • <view_name>: The fully-qualified view name you want to give to the view to create from the specified table, such as “LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.MY_NEW_VIEW”.

  • <database2.public.sampletable>: The fully-qualified table name from the additional database you’re sharing from, such as “ANOTHER_DB.PUBLIC.MOBILE_OUTPUT_TABLE”.

  • <database1>: The database name of database that was specified in the initial share, such as “LIVERAMP_CUSTOMER_DEMO_DB”.

  • <share1>: The share name that was specified in the initial share, such as “TEST_SHARE”.

  • <database1.schema1>: The fully-qualified schema name, such as “LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC”.

  • <database2>: The additional database that contains the table you’re creating the view from, such as “ANOTHER_DB".

For example, let’s say you want to share table data from a different database with the parameters listed below:

  • <view_name>: “LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.MY_NEW_VIEW”

  • <database2.public.sampletable>: “ANOTHER_DB.PUBLIC.MOBILE_OUTPUT_TABLE”

  • <database1>: “LIVERAMP_CUSTOMER_DEMO_DB”

  • <share1>: “TEST_SHARE”

  • <database1.schema1>: “LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC”

  • <database2>: “ANOTHER_DB".

You would insert those parameters into the variables and run the following commands:

CREATE SECURE VIEW LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.MY_NEW_VIEW AS SELECT * FROM ANOTHER_DB.PUBLIC.MOBILE_OUTPUT_TABLE;

GRANT USAGE ON DATABASE LIVERAMP_CUSTOMER_DEMO_DB TO SHARE TEST_SHARE;

GRANT USAGE ON SCHEMA LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC TO SHARE TEST_SHARE;

GRANT REFERENCE_USAGE ON DATABASE ANOTHER_DB TO SHARE TEST_SHARE;

GRANT SELECT ON VIEW LIVERAMP_CUSTOMER_DEMO_DB.PUBLIC.MY_NEW_VIEW TO SHARE TEST_SHARE;

Once the share has been received into your LiveRamp account, the view will be available in the LiveRamp UI for segment building (typically within 10 minutes). Segments created from this data can then be distributed to your desired destinations.

Note

For more information on sharing data from multiple Snowflake databases, see this Snowflake article.