Campaign Manager integration summary

Stitch’s Campaign Manager integration replicates data using the Campaign Manager 360 API . Refer to the Schema section for a list of objects available for replication.

Campaign Manager feature snapshot

A high-level look at Stitch's Campaign Manager (v1) integration, including release status, useful links, and the features supported in Stitch.

STITCH
Release status

Released on August 17, 2018

Supported by

Singer Community

Stitch plan

Standard

API availability

Available

Singer GitHub repository

singer-io/tap-doubleclick-campaign-manager

REPLICATION SETTINGS
Anchor Scheduling

Supported

Advanced Scheduling

Unsupported

Table-level reset

Unsupported

Configurable Replication Methods

Unsupported

DATA SELECTION
Table selection

Supported

Column selection

Unsupported

Select all

Supported

TRANSPARENCY
Extraction Logs

Supported

Loading Reports

Supported

Connecting Campaign Manager

Campaign Manager setup requirements

To set up Campaign Manager in Stitch, you need:

  • A Campaign Manager account. Refer to Google’s website for signup information.

  • API access. Most accounts have this enabled by default. If you’re not sure, contact your representative or the support team.

  • Access to the reports you want to replicate. Stitch will only be able to replicate the reports that the user who authorizes the integration has access to.


Step 1: Verify report access

Before you connect Campaign Manager to Stitch, you should verify that you have access to the reports you want to replicate. Stitch will only be able to replicate data for the same reports that you have access to in Campaign Manager.

  1. Sign into your Campaign Manager account and navigate to the Report Builder page.
  2. Under Reports, click My Reports.
  3. A list of all the reports you have access to will display:

    List of reports in Campaign Manager

  4. Verify that the reports you want to replicate are listed on this page.

Step 2: Locate your Campaign Manager profile ID

  1. Sign into your Campaign Manager account.
  2. Click the user menu (your icon) in the top right corner.
  3. In the dropdown beneath the Sign out button will be a list of the profiles you have access to.
  4. Locate the ID of the profile you want to connect. This will be a seven digit number next to the name of the profile. For example: 9999999

    An example is highlighted in the image to the right.

  5. Copy the profile ID.

Keep this handy - you’ll need it in the next step.

Step 3: Add Campaign Manager as a Stitch data source

  1. Sign into your Stitch account.
  2. On the Stitch Dashboard page, click the Add Integration button.

  3. Click the Campaign Manager icon.

  4. Enter a name for the integration. This is the name that will display on the Stitch Dashboard for the integration; it’ll also be used to create the schema in your destination.

    For example, the name “Stitch Campaign Manager” would create a schema called stitch_campaign_manager in the destination. Note: Schema names cannot be changed after you save the integration.

  5. In the Profile ID field, paste the ID of the Campaign Manager profile from Step 2. This value should be a seven digit number such as 9999999.

Step 4: Create a replication schedule

In the Replication Frequency section, you’ll create the integration’s replication schedule. An integration’s replication schedule determines how often Stitch runs a replication job, and the time that job begins.

Campaign Manager integrations support the following replication scheduling methods:

To keep your row usage low, consider setting the integration to replicate less frequently. See the Understanding and Reducing Your Row Usage guide for tips on reducing your usage.

Step 5: Authorize Stitch to access Campaign Manager

  1. If you aren’t already signed into your Google account, you’ll be prompted for your credentials.
  2. After you sign in, you’ll see a list of the permissions requested by Stitch:
    • View and manage DoubleClick for Advertisers reports - This is required to allow Stitch to view and run reports. Note: Stitch will not alter report settings, and will only ever read data. Refer to the Replication section below for more info.
  3. To grant access, click the Allow button.
  4. After you’ve granted access, you’ll be redirected back to Stitch to finish setting up the integration.

Step 6: Set objects to replicate

The last step is to select the tables you want to replicate. Learn about the available tables for this integration.

Note: If a replication job is currently in progress, new selections won’t be used until the next job starts.

For Campaign Manager integrations, you can select:

  1. **Individual tables **

  2. All tables and columns

Click the tabs to view instructions for each selection method.

  1. In the integration’s Tables to Replicate tab, locate a table you want to replicate.
  2. To track a table, click the checkbox next to the table’s name. A blue checkmark means the table is set to replicate.

  3. Repeat this process for all the tables you want to replicate.
  4. When finished, click the Finalize Your Selections button at the bottom of the screen to save your selections.
  1. Click into the integration from the Stitch Dashboard page.
  2. Click the Tables to Replicate tab.

  3. In the list of tables, click the box next to the Table Names column.
  4. In the menu that displays, click Track all Tables and Fields:

    The Track all Tables and Fields menu in the Tables to Replicate tab

  5. Click the Finalize Your Selections button at the bottom of the page to save your data selections.

Initial and historical replication jobs

After you finish setting up Campaign Manager, its Sync Status may show as Pending on either the Stitch Dashboard or in the Integration Details page.

For a new integration, a Pending status indicates that Stitch is in the process of scheduling the initial replication job for the integration. This may take some time to complete.

Free historical data loads

The first seven days of replication, beginning when data is first replicated, are free. Rows replicated from the new integration during this time won’t count towards your quota. Stitch offers this as a way of testing new integrations, measuring usage, and ensuring historical data volumes don’t quickly consume your quota.


Campaign Manager replication

When Stitch replicates data from Campaign Manager, the process will look like this:

  1. Stitch runs the selected report using the report’s defined date range and included dimensions and metrics.
  2. Campaign Manager creates a CSV file of the report results.
  3. Stitch replicates the results from the CSV.

Each run of a report will have its own CSV file in Campaign Manager, which you can access by signing into your Campaign Manager account.

Report date ranges

When Stitch replicates data for a given report, it will use the date range currently defined in Campaign Manager for that report.

For example: The image below shows the configuration for a report named ad_performance_report, where the date range is set to the last 30 days. When Stitch replicates data for this report, it will run the report using these settings:

Report date range field highlighted in Campaign Manager

Data loading and Append-Only Replication

When Stitch loads the extracted data into your destination, it will do so using Append-Only Replication. This is a type of Incremental Replication where existing rows aren’t updated, but appended to the end of the table.

Additionally, the number of rows loaded into the table during each replication job is dependent on the combination of unique values in the dimension columns you track. See the Column Selection and Statistic Aggregation section for more info and examples.

Example

Let’s say these columns are tracking in the ad_performance_report table:

  • date (dimension) - The date pertaining to the record.

  • campaignId (dimension) - This is the ID associated with a campaign. In this example, there are two campaigns: 929007494 and 929599581
  • device (dimension) - The device type. There are two values for this example: Computer and Tablet
  • impressions (metric) - The total number of impressions.

Every time Stitch replicates and loads data, a row for each unique combination of the dimension columns will be appended to the end of the table:

_sdc_report_datetime date   campaignId device impressions
2017-10-01 17:48:26.791 2017-09-10 00:00:00   929007494 Computer 61
2017-10-01 17:48:26.791 2017-09-10 00:00:00   929007494 Tablet 15
2017-10-01 17:48:26.791 2017-09-10 00:00:00   929599581 Computer 37
2017-10-01 17:48:26.791 2017-09-10 00:00:00   929599581 Tablet 9

Query for the latest data

If you want only the most recently replicated data for any Campaign Manager table, you can use the sample query below to account for the Append-Only Replication Stitch uses.

This query will use the report’s Dimensions and the _sdc_report_datetime column to return the latest data:

SELECT *
  FROM (
        SELECT *,
        RANK() OVER (PARTITION BY dimension_1, dimension_2, etc., 
                     ORDER BY _sdc_report_datetime DESC)
        FROM ad_performance_report
        ORDER BY dimension_1, dimension_2, etc. ASC
       ) AS latest
 WHERE latest.rank = 1

In this query:

  1. A subquery first uses a window function to create a ‘window’ of data for each combination of Dimensions,
  2. The values of the _sdc_report_datetime column are ranked within each window partition, and
  3. Then, in the outer query, only the rows with _sdc_report_datetime values ranked as 1 - which is equal to the maximum timestamp - are returned.

Campaign Manager table reference


Questions? Feedback?

Did this article help? If you have questions or feedback, feel free to submit a pull request with your suggestions, open an issue on GitHub, or reach out to us.