Model sync (Reverse ETL) from BigQuery to LinkedIn Ads
Prerequisites:
- Ensure you have the Polytomic Terraform provider installed.
- Obtain your Polytomic API key and set it as an environment variable.
To create a Model Sync from BigQuery to LinkedIn Ads using Terraform, follow these steps:
1. Configure the Polytomic provider
Begin by configuring the Polytomic provider in your Terraform script:
Ensure that var.polytomic_api_key is defined in your variables or passed appropriately.
🤝 Partner keys
If you are using a Partner Key, specify the key along with an organization user email. A user with that email will be used when operating on an organization. The user will be created if it does not exist.
2. Create a BigQuery connection
Define a resource for the BigQuery connection:
Note that the service account key is loaded using the file function here; any
string value or variable is acceptable.
3. Create a LinkedIn Ads connection
In order to activate the required LinkedIn Ads API permissions, it’s best to create a LinkedIn Ads connection using Polytomic’s OAuth flow. This can be done in the admin console or using the Polytomic embedded authentication.
After establishing the connection, it can be referenced using the Terraform datasource.
4. Create a Polytomic source data model for a LinkedIn Ads audience
Define a resource for the data model that queries BigQuery:
5. Create a Model Sync from BigQuery to LinkedIn Ads
Define a resource to sync the data model to LinkedIn Ads. In this example we’re creating an update-only sync to Salesforce Contacts which uses the email address to match records.
6. Apply the Terraform Configuration
Initialize Terraform and apply the configuration:
Review the changes and confirm to proceed.
For more details, refer to the Polytomic Terraform provider documentation.
