How to preprocess customer data for consumer analytics while complying with data privacy?

You are preparing an organization-wide dataset. You need to preprocess customer data stored in a restricted bucket in Cloud Storage. The data will be used to create consumer analyses. You need to comply with data privacy requirements. What should you do?

  1. Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery. Source Reference Answer
  2. Use customer-managed encryption keys (CMEK) to directly encrypt the data in Cloud Storage. Use federated queries from BigQuery. Share the encryption key by following the principle of least privilege.
  3. Use the Cloud Data Loss Prevention API and Dataflow to detect and remove sensitive fields from the data in Cloud Storage. Write the filtered data in BigQuery.
  4. Use Dataflow and Cloud KMS to encrypt sensitive fields and write the encrypted data in BigQuery. Share the encryption key by following the principle of least privilege.

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The exam tests the distinction between masking, removing, and encrypting sensitive data; masking preserves analytical utility while still protecting PII, unlike full removal or encryption that can make data unusable or still expose it.

For privacy-compliant consumer analytics, use Cloud Dataflow with the Cloud Data Loss Prevention (DLP) API to mask sensitive data before writing to BigQuery. Community consensus strongly supports this approach for balancing data utility and privacy.

Choosing C (removing sensitive fields) is a common mistake because it seems more private, but it destroys the ability to perform consumer-level analysis by eliminating identifying information entirely; masking retains useful patterns while de-identifying the data.

Community Discussion (5 comments)

raaad 👍 13 Selected: A
  • Prioritizes Data Privacy: It protects sensitive information by masking it, reducing the risk of exposure in case of unauthorized access or accidental leaks. - Reduces Data Sensitivity: Masking renders sensitive data unusable for attackers, even if they gain access to it. - Preserves Data Utility: Masked data can still be used for consumer analyses, as patterns and relationships are often preserved, allowing meaningful insights to be derived.
desertlotus1211 👍 1 Selected: C
If I had to choose... I choose C or A... A can still leave partial sensitive data available.
AlizCert 👍 3 Selected: A
What made me decide on A instead of C was the "The data will be used to create consumer analyses" sentence. Having all the PIIs completely redacted from the records, we were unable to distinguish between the individual customers.
Matt_108 👍 1 Selected: A
Option A, agree with raaad explanation
scaenruy 👍 2 Selected: A
A. Use Dataflow and the Cloud Data Loss Prevention API to mask sensitive data. Write the processed data in BigQuery.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option A is correct because it uses Cloud DLP and Dataflow to mask sensitive data, which de-identifies the dataset while preserving its utility for consumer analyses. Masking replaces sensitive values (e.g., names, emails) with tokens or placeholders, reducing risk of exposure while still allowing analysis of relationships and patterns. Writing the processed data to BigQuery enables scalable, queryable analytics on the de-identified data, meeting both business and privacy requirements.

Why the Other Options Are Wrong

Option B (CMEK and federated queries) only encrypts data at rest and does not de-identify it; authorized users can still see the original sensitive data, so it does not comply with privacy requirements for analytics. Option C removes sensitive fields entirely, which over-removes data and prevents consumer-level analyses—as noted by comments, without PII you cannot distinguish individual customers. Option D (Dataflow and Cloud KMS) also encrypts but does not truly de-identify; shared keys and encrypted fields still allow decryption, defeating the purpose of privacy protection.

Community Comment Notes

Comment [1] accurately highlights that masking prioritizes data privacy, reduces sensitivity, and preserves data utility, all essential for consumer analyses. Comment [2] reinforces the reasoning for A over C by noting that full redaction makes it impossible to distinguish individual customers. Comment [4] raises a valid concern that masking may leave partial sensitive data, but that is acceptable when the goal is de-identification rather than complete removal, and masking is a standard DLP technique for this scenario.

Official Reference

Exam Strategy

When a question involves privacy and analytics, look for keywords like 'consumer analyses' — that clue points to de-identification (masking) rather than encryption or removal. Remember that DLP offers multiple de-identification techniques; masking is preferred when the data must remain analytically useful while protecting individual privacy.

Related Analysis

← Back to PDE Study Guide