Resource
MeasurementConsumer
A consumer ofMeasurement results. For example, an advertiser or ad agency.
Resource name pattern: measurementConsumers/{measurement_consumer}
Resource name identifier.
The X.509 certificate belonging to this
MeasurementConsumer in DER format which can be used to verify public_key.Resource name of the
Certificate belonging to this MeasurementConsumer which can be used to verify public_key.The x509_der field of this resource matches certificate_der. Output only.Serialized
EncryptionPublicKey for this MeasurementConsumer, which can be verified using certificate.The version of the EncryptionPublicKey message must match the API version used to last update this resource.Display name of the
MeasurementConsumer.Resource names of owner
Accounts. Output only.Token to create a
MeasurementConsumer resource. Required, immutable, input only.Methods
GetMeasurementConsumer
Returns theMeasurementConsumer with the specified resource key.
Request
Resource name of the MeasurementConsumer.Format:
measurementConsumers/{measurement_consumer}MeasurementConsumer resource.
Example
CreateMeasurementConsumer
Creates (registers) aMeasurementConsumer.
Request
The
MeasurementConsumer to create.The name field will be ignored, and the system will assign an ID.Required fields:certificate_der: X.509 certificate in DER formatpublic_key: Serialized encryption public keymeasurement_consumer_creation_token: Token to authorize creation
MeasurementConsumer resource.
Example
- The
measurement_consumer_creation_tokenmust be a valid token obtained from the system administrator. - The
certificate_dermust contain a valid X.509 certificate in DER format. - The
public_keymust be a signed message containing the encryption public key that can be verified using the certificate.
AddMeasurementConsumerOwner
Adds an owner to the specifiedMeasurementConsumer.
Request
Resource name of the MeasurementConsumer.Format:
measurementConsumers/{measurement_consumer}Resource name of the
Account to add as an owner of this MeasurementConsumer.Format: accounts/{account}MeasurementConsumer resource with the new owner added to the owners list.
Example
- The authenticated user must have permission to modify the MeasurementConsumer.
- The specified account must exist.
- If the account is already an owner, this operation is idempotent.
RemoveMeasurementConsumerOwner
Removes an owner from the specifiedMeasurementConsumer.
Request
Resource name of the MeasurementConsumer.Format:
measurementConsumers/{measurement_consumer}Resource name of the
Account to remove as an owner of this MeasurementConsumer.Format: accounts/{account}MeasurementConsumer resource with the owner removed from the owners list.
Example
- The authenticated user must have permission to modify the MeasurementConsumer.
- If the account is not currently an owner, this operation is idempotent.
- At least one owner must remain after the removal.
Workflow
Creating a MeasurementConsumer
- Obtain Creation Token: Get a
measurement_consumer_creation_tokenfrom your system administrator. - Prepare Certificate: Generate an X.509 certificate and convert it to DER format.
- Prepare Public Key: Create an encryption public key and sign it with your certificate.
- Create Resource: Call
CreateMeasurementConsumerwith the required fields. - Store Credentials: Securely store your private keys and certificate for signing measurement requests.
Managing Owners
- Add Owners: Use
AddMeasurementConsumerOwnerto grant ownership access to additional accounts. - Remove Owners: Use
RemoveMeasurementConsumerOwnerto revoke ownership access. - View Owners: Use
GetMeasurementConsumerto see the current list of owners.
Security Considerations
- Certificate Management: Keep your private key secure. If compromised, revoke the certificate and create a new MeasurementConsumer.
- Encryption Keys: The public key is used to encrypt measurement results. Only you should have the corresponding private key.
- Owner Access: Owners have full access to the MeasurementConsumer and can create measurements. Only add trusted accounts.
- Creation Tokens: Protect creation tokens as they authorize creating new MeasurementConsumers.
