Campaign Manager transfers

The BigQuery Data Transfer Service for Entrada Manager allows you to automatically schedule and manage recurring load jobs for Entrada Manager reporting data.

Supported Reports

The BigQuery Data Transfer Service for Entrada Manager (formerly known as DoubleClick Campaign Director) currently supports the following reporting options:

  • Data Transfer v2 (Entrada Manager DTv2) files
  • Data Transfer v2 (Entrada Managing director DTv2) match tables

For information on how Campaign Manager reports are transformed into BigQuery tables and views, see Campaign Manager report transformations.

Reporting option Support
Schedule

Every 8 hours, based on the creation time.

Not configurable

Refresh window

Final 2 days

Not configurable

Maximum backfill duration

Terminal 60 days

Campaign Manager retains Data Transfer files for up to 60 days. Files older than threescore days are deleted by Campaign Managing director.

Earlier you begin

Earlier you create a Campaign Manager transfer:

  • Verify that you take completed all actions required to enable the BigQuery Data Transfer Service.
  • Create a BigQuery dataset to store the Campaign Director information.
  • Ensure that your arrangement has access to Campaign Manager Data Transfer v2 (Campaign Director DTv2) files. These files are delivered by the Campaign Manager team to a Cloud Storage bucket. To proceeds access to Campaign Manager DTv2 files, your next step depends on if you have a direct contract with Campaign Manager. In both cases, additional charges might apply.

    • If you have a contract with Campaign Manager, contact Campaign Manager support to setup Campaign Manager DTv2 files.
    • If you do not have a contract with Campaign Manager, your bureau or Campaign Manager reseller may take admission to Campaign Manager DTv2 files. Contact your bureau or reseller for admission to these files.

    After completing this step, yous will receive a Cloud Storage bucket name similar to the following:

    dcdt_-dcm_account123456

  • If you lot intend to prepare transfer run notifications for Pub/Sub, you must have pubsub.topics.setIamPolicy permissions. For more information, see BigQuery Data Transfer Service run notifications.

Required permissions

  • BigQuery: Ensure that the person creating the transfer has the following permissions in BigQuery:

    • bigquery.transfers.update permissions to create the transfer
    • Both bigquery.datasets.become and bigquery.datasets.update permissions on the target dataset

    The bigquery.admin predefined IAM role includes bigquery.transfers.update, bigquery.datasets.update and bigquery.datasets.get permissions. For more information on IAM roles in BigQuery Information Transfer Service, see Access control reference.

  • Campaign Manager: Read access to the Entrada Managing director DTv2 files stored in Cloud Storage. Access is managed by the entity from which y'all received the Cloud Storage bucket.

Setting up a Campaign Director transfer

Setting upwards a Entrada Manager transfer requires a:

  • Cloud Storage saucepan: The Cloud Storage bucket URI for your Campaign Manager DTv2 files every bit described in Earlier you brainstorm. The bucket name should look like the following:

    dcdt_-dcm_account123456

  • Entrada Managing director ID: Your Campaign Managing director Network, Advertiser, or Floodlight ID. Network ID is the parent in the hierarchy.

Finding your Campaign Manager ID

To retrieve your Campaign Manager ID, you can employ the Cloud Storage console to examine the files in your Entrada Director Data Transfer Cloud Storage bucket. The Campaign Managing director ID is used to lucifer files in the provided Cloud Storage bucket. The ID is embedded in the file name, non the Cloud Storage bucket name.

For example:

  • In a file named dcm_account123456_activity_*, the ID is 123456.
  • In a file named dcm_floodlight7890_activity_*, the ID is 7890.
  • In a file named dcm_advertiser567_activity_*, the ID is 567.

(Optional) Finding your file name prefix

In rare cases, the files in your Cloud Storage bucket may have custom, nonstandard file names that were set upwardly for you by the Google Marketing Platform services team.

For example:

  • In a file named dcm_account123456custom_activity_*, the prefix is dcm_account123456custom — everything before _activity.

Contact Campaign Manager back up if you demand help.

Create a data transfer for Campaign Manager

Console

  1. Go to the BigQuery page in the Cloud console.

    Go to the BigQuery page

  2. Click Transfers.

  3. Click Create Transfer.

  4. On the Create Transfer folio:

    • In the Source type section, for Source, cull Campaign Director.

      Transfer source

    • In the Transfer config name section, for Display name, enter a name for the transfer such equally My Transfer. The transfer name can be any value that allows you lot to easily identify the transfer if you lot need to modify it later.

      Transfer name

    • In the Schedule options section, for Schedule, leave the default value (Start now) or click Get-go at a gear up fourth dimension.

      • For Repeats, choose an option for how ofttimes to run the transfer.

        • Daily (default)
        • Weekly
        • Monthly
        • Custom
        • On-demand

        If you choose an option other than Daily, boosted options are available. For example, if you lot choose Weekly, an option appears for you to select the day of the week.

      • For Start appointment and run time, enter the date and fourth dimension to offset the transfer. If yous cull Kickoff now, this choice is disabled.

        Transfer schedule

    • In the Destination settings department, for Destination dataset, cull the dataset you created to store your data.

      Transfer dataset

    • In the Data source details section:

      • For Cloud Storage bucket, enter or browse for the name of the Deject Storage bucket that stores your Data Transfer V2.0 files. When y'all enter the bucket proper name, practise non include gs://.
      • For DoubleClick ID, enter the appropriate Campaign Managing director ID.
      • (Optional) If your files have standard names like these examples, leave the File name prefix field blank. Consummate File proper name prefix only if the files in your Cloud Storage bucket have custom file names like this case.

        Campaign Manager source details

    • (Optional) In the Notification options section:

      • Click the toggle to enable e-mail notifications. When you enable this option, the transfer administrator receives an email notification when a transfer run fails.
      • For Select a Pub/Sub topic, choose your topic name or click Create a topic. This choice configures Pub/Sub run notifications for your transfer.
  5. Click Save.

bq

Enter the bq mk command and supply the transfer creation flag — --transfer_config. The following flags are as well required:

  • --data_source
  • --target_dataset
  • --display_name
  • --params
bq mk --transfer_config \ --project_id=project_id                        \ --target_dataset=dataset                        \ --display_name=name                        \ --params='parameters' \ --data_source=data_source                      

Where:

  • project_id is your project ID.
  • dataset is the target dataset for the transfer configuration.
  • proper name is the display name for the transfer configuration. The transfer proper name can be whatever value that allows you to easily identify the transfer if yous need to modify it later.
  • parameters contains the parameters for the created transfer configuration in JSON format. For example: --params='{"param":"param_value"}'. For Campaign Managing director, you must supply the bucket and network_id, parameters. bucket is the Deject Storage bucket that contains your Entrada Managing director DTv2 files. network_id is your network, floodlight, or advertiser ID.
  • data_source is the data source — dcm_dt (Campaign Director).

You can too supply the --project_id flag to specify a detail project. If --project_id isn't specified, the default projection is used.

For example, the following command creates a Campaign Manager transfer named My Transfer using Entrada Manager ID 123456, Cloud Storage bucket dcdt_-dcm_account123456, and target dataset mydataset. The parameter file_name_prefix is optional and used for rare, custom file names only.

The transfer is created in the default project:

                        bq mk --transfer_config \ --target_dataset=mydataset \ --display_name='My Transfer' \ --params='{"bucket": "dcdt_-dcm_account123456","network_id": "123456","file_name_prefix":"YYY"}' \ --data_source=dcm_dt                                              

Later on running the command, yous receive a message like the following:

[URL omitted] Please re-create and paste the above URL into your web browser and follow the instructions to retrieve an authentication code.

Follow the instructions and paste the hallmark lawmaking on the command line.

API

Employ the projects.locations.transferConfigs.create method and supply an case of the TransferConfig resource.

Coffee

Troubleshooting Entrada Manager transfer setup

If you are having bug setting up your transfer, see Campaign Director transfer bug in Troubleshooting transfer configurations.

Querying your data

When your data is transferred to BigQuery, the data is written to ingestion-time partitioned tables. For more information, see Introduction to partitioned tables.

If you query your tables direct instead of using the machine-generated views, you must employ the _PARTITIONTIME pseudo-cavalcade in your query. For more than data, encounter Querying partitioned tables.

Campaign Manager sample queries

You can apply the following Campaign Managing director sample queries to analyze your transferred data. You lot can also use the queries in a visualization tool such as Google Data Studio. These queries are provided to help you get started on querying your Campaign Manager data with BigQuery. For boosted questions on what you lot tin can do with these reports, contact your Campaign Manager technical representative.

In each of the following queries, supplant the variables like dataset with your values.

Latest campaigns

The following sample query retrieves the latest campaigns.

Panel

SELECT   Campaign,   Campaign_ID FROM   `dataset.match_table_campaigns_campaign_manager_id` WHERE   _DATA_DATE = _LATEST_DATE                      

bq

bq query --use_legacy_sql=false \ 'SELECT    Campaign,    Campaign_ID  FROM    `dataset.match_table_campaigns_campaign_manager_id`  WHERE    _DATA_DATE = _LATEST_DATE'                      

Impressions and distinct users past campaign

The following sample query analyzes the number of impressions and distinct users by entrada over the past 30 days.

Console

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 Twenty-four hours) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 Twenty-four hours)   SELECT     Campaign_ID,     _DATA_DATE Equally Engagement,     COUNT(*) AS count,     COUNT(Singled-out User_ID) Equally du   FROM     `dataset.impression_campaign_manager_id`   WHERE     _DATA_DATE Between                        start_date                        AND                        end_date                        Group Past     Campaign_ID,     Engagement                      

bq

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 24-hour interval) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -ane DAY)  bq query --use_legacy_sql=false \ 'SELECT   Campaign_ID,   _DATA_DATE Every bit Date,   COUNT(*) Equally count,   COUNT(DISTINCT User_ID) Every bit du FROM   `dataset.impression_campaign_manager_id` WHERE   _DATA_DATE Betwixt                        start_date                        AND                        end_date                        Group BY   Campaign_ID,   Date'                      

Latest campaigns ordered past entrada and date

The following sample query analyzes the latest campaigns in the past 30 days, ordered past campaign and date.

Console

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 Solar day) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -one Twenty-four hour period) SELECT   Campaign,   Campaign_ID,   Date FROM (   SELECT     Campaign,     Campaign_ID   FROM     `dataset.match_table_campaigns_campaign_manager_id`   WHERE     _DATA_DATE = _LATEST_DATE ),   (   SELECT     appointment Every bit Date   FROM     `bigquery-public-data.utility_us.date_greg`   WHERE     Date BETWEEN                        start_date                        AND                        end_date                        ) ORDER Past   Campaign_ID,   Appointment                      

bq

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -i DAY) bq query --use_legacy_sql=simulated \ 'SELECT   Campaign,   Campaign_ID,   Date FROM (   SELECT     Campaign,     Campaign_ID   FROM     `dataset.match_table_campaigns_campaign_manager_id`   WHERE     _DATA_DATE = _LATEST_DATE ),   (   SELECT     date As Date   FROM     `bigquery-public-data.utility_us.date_greg`   WHERE     Date BETWEEN                        start_date                        AND                        end_date                        ) ORDER By   Campaign_ID,   Appointment'                      

Impressions and singled-out users by campaign within a engagement range

The following sample query analyzes the number of impressions and distinct users by entrada betwixt start_date and end_date.

Panel

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 Mean solar day) SELECT   base.*,   imp.count AS imp_count,   imp.du AS imp_du FROM (   SELECT     *   FROM (     SELECT       Campaign,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       appointment AS Appointment     FROM       `bigquery-public-data.utility_us.date_greg`     WHERE       Date Between                        start_date                        AND                        end_date                        ) ) Equally base LEFT JOIN (   SELECT     Campaign_ID,     _DATA_DATE Equally Date,     COUNT(*) AS count,     COUNT(Singled-out User_ID) AS du   FROM     `dataset.impression_campaign_manager_id`   WHERE     _DATA_DATE Betwixt                        start_date                        AND                        end_date                        Group BY     Campaign_ID,     Engagement ) AS imp ON   base.Campaign_ID = imp.Campaign_ID   AND base of operations.Date = imp.Engagement WHERE   base.Campaign_ID = imp.Campaign_ID   AND base.Date = imp.Date Social club BY   base.Campaign_ID,   base of operations.Date                      

bq

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 Twenty-four hours) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 24-hour interval) bq query --use_legacy_sql=false \ 'SELECT   base.*,   imp.count Every bit imp_count,   imp.du Every bit imp_du FROM (   SELECT     *   FROM (     SELECT       Campaign,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       engagement AS Date     FROM       `bigquery-public-data.utility_us.date_greg`     WHERE       Date BETWEEN                        start_date                        AND                        end_date                        ) ) AS base of operations LEFT Join (   SELECT     Campaign_ID,     _DATA_DATE Every bit Date,     COUNT(*) As count,     COUNT(DISTINCT User_ID) AS du   FROM     `dataset.impression_campaign_manager_id`   WHERE     _DATA_DATE Betwixt                        start_date                        AND                        end_date                        GROUP By     Campaign_ID,     Engagement ) AS imp ON   base.Campaign_ID = imp.Campaign_ID   AND base.Appointment = imp.Date WHERE   base.Campaign_ID = imp.Campaign_ID   AND base.Date = imp.Date Lodge BY   base of operations.Campaign_ID,   base of operations.Date'                      

Impressions, clicks, activities and distinct users by entrada

The following sample query analyzes the number of impressions, clicks, activities, and distinct users past campaign over the past 30 days. In this query, replace the variables similar campaign_list with your values. For instance, replace campaign_list with a comma separated list of all the Campaign Manager campaigns of involvement within the scope of the query.

Console

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY) SELECT   base.*,   imp.count As imp_count,   imp.du Every bit imp_du,   click.count Every bit click_count,   click.du AS click_du,   activity.count Every bit activity_count,   activity.du Every bit activity_du FROM (   SELECT     *   FROM (     SELECT       Entrada,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       date As Date     FROM       `bigquery-public-information.utility_us.date_greg`     WHERE       Date Betwixt DATE_ADD(CURRENT_DATE(), INTERVAL -31 Twenty-four hours)       AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 Day) ) ) AS base LEFT Bring together (   SELECT     Campaign_ID,     _DATA_DATE AS Date,     COUNT(*) AS count,     COUNT(DISTINCT User_ID) As du   FROM     `dataset.impression_campaign_manager_id`   WHERE     _DATA_DATE BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -i Twenty-four hours)   GROUP BY     Campaign_ID,     Date ) AS imp ON   base.Campaign_ID = imp.Campaign_ID   AND base.Date = imp.Date LEFT Join (   SELECT     Campaign_ID,     _DATA_DATE AS Date,     COUNT(*) Equally count,     COUNT(DISTINCT User_ID) AS du   FROM     `dataset.click_campaign_manager_id`   WHERE     _DATA_DATE Betwixt DATE_ADD(CURRENT_DATE(), INTERVAL -31 24-hour interval)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -ane 24-hour interval)   GROUP BY     Campaign_ID,     Date ) As click ON   base.Campaign_ID = click.Campaign_ID   AND base.Date = click.Date LEFT JOIN (   SELECT     Campaign_ID,     _DATA_DATE AS Engagement,     COUNT(*) Every bit count,     COUNT(Distinct User_ID) Every bit du   FROM     `dataset.activity_campaign_manager_id`   WHERE     _DATA_DATE BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)   Grouping By     Campaign_ID,     Date ) As activity ON   base.Campaign_ID = activity.Campaign_ID   AND base.Appointment = activity.Date WHERE   base.Campaign_ID IN                        campaign_list                        AND (base.Date = imp.Date     OR base.Appointment = click.Date     OR base.Date = action.Engagement) ORDER Past   base.Campaign_ID,   base of operations.Date                      

bq

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -one Day) bq query --use_legacy_sql=false \ 'SELECT   base.*,   imp.count AS imp_count,   imp.du AS imp_du,   click.count AS click_count,   click.du Equally click_du,   activity.count AS activity_count,   activity.du AS activity_du FROM (   SELECT     *   FROM (     SELECT       Campaign,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       date As Appointment     FROM       `bigquery-public-information.utility_us.date_greg`     WHERE       Date BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 24-hour interval)       AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY) ) ) AS base LEFT JOIN (   SELECT     Campaign_ID,     _DATA_DATE AS Appointment,     COUNT(*) Equally count,     COUNT(Distinct User_ID) AS du   FROM     `dataset.impression_campaign_manager_id`   WHERE     _DATA_DATE BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)   GROUP BY     Campaign_ID,     Date ) AS imp ON   base.Campaign_ID = imp.Campaign_ID   AND base.Date = imp.Engagement LEFT JOIN (   SELECT     Campaign_ID,     _DATA_DATE As Date,     COUNT(*) AS count,     COUNT(DISTINCT User_ID) Equally du   FROM     `dataset.click_campaign_manager_id`   WHERE     _DATA_DATE Between DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)   Group BY     Campaign_ID,     Date ) Equally click ON   base.Campaign_ID = click.Campaign_ID   AND base of operations.Date = click.Appointment LEFT JOIN (   SELECT     Campaign_ID,     _DATA_DATE AS Date,     COUNT(*) As count,     COUNT(Distinct User_ID) AS du   FROM     `dataset.activity_campaign_manager_id`   WHERE     _DATA_DATE BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 Twenty-four hour period)   Group BY     Campaign_ID,     Date ) Equally activity ON   base of operations.Campaign_ID = activeness.Campaign_ID   AND base.Date = activeness.Engagement WHERE   base.Campaign_ID IN                        campaign_list                        AND (base.Date = imp.Engagement     OR base of operations.Engagement = click.Appointment     OR base.Date = activity.Date) ORDER BY   base.Campaign_ID,   base.Date'                      

Entrada activity

The post-obit sample query analyzes entrada action over the past 30 days. In this query, replace the variables like campaign_list with your values. For example, replace campaign_list with a comma separated listing of all the Entrada Manager campaigns of interest within the scope of the query.

Console

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 Mean solar day) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 24-hour interval) SELECT   base.*,   activity.count AS activity_count,   activity.du Every bit activity_du FROM (   SELECT     *   FROM (     SELECT       Campaign,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       mt_at.Activity_Group,       mt_ac.Action,       mt_ac.Activity_Type,       mt_ac.Activity_Sub_Type,       mt_ac.Activity_ID,       mt_ac.Activity_Group_ID     FROM       `dataset.match_table_activity_cats_campaign_manager_id` As mt_ac     Bring together (       SELECT         Activity_Group,         Activity_Group_ID       FROM         `dataset.match_table_activity_types_campaign_manager_id`       WHERE         _DATA_DATE = _LATEST_DATE ) Every bit mt_at     ON       mt_at.Activity_Group_ID = mt_ac.Activity_Group_ID     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       date Every bit Date     FROM       `bigquery-public-data.utility_us.date_greg`     WHERE       Engagement BETWEEN                        start_date                        AND                        end_date                        ) ) As base LEFT JOIN (   SELECT     Campaign_ID,     Activity_ID,     _DATA_DATE AS Date,     COUNT(*) AS count,     COUNT(Distinct User_ID) Equally du   FROM     `dataset.activity_campaign_manager_id`   WHERE     _DATA_DATE BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -31 Day)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -one Solar day)   GROUP BY     Campaign_ID,     Activity_ID,     Date ) AS activity ON   base.Campaign_ID = activity.Campaign_ID   AND base of operations.Activity_ID = activeness.Activity_ID   AND base.Date = action.Appointment WHERE   base of operations.Campaign_ID IN                        campaign_list                        AND base of operations.Activity_ID = activity.Activity_ID ORDER Past   base.Campaign_ID,   base.Activity_Group_ID,   base.Activity_ID,   base.Date                      

bq

# START_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY) # END_DATE = DATE_ADD(CURRENT_DATE(), INTERVAL -1 24-hour interval) bq query --use_legacy_sql=false \ 'SELECT   base.*,   activeness.count AS activity_count,   activeness.du AS activity_du FROM (   SELECT     *   FROM (     SELECT       Campaign,       Campaign_ID     FROM       `dataset.match_table_campaigns_campaign_manager_id`     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       mt_at.Activity_Group,       mt_ac.Activeness,       mt_ac.Activity_Type,       mt_ac.Activity_Sub_Type,       mt_ac.Activity_ID,       mt_ac.Activity_Group_ID     FROM       `dataset.match_table_activity_cats_campaign_manager_id` AS mt_ac     JOIN (       SELECT         Activity_Group,         Activity_Group_ID       FROM         `dataset.match_table_activity_types_campaign_manager_id`       WHERE         _DATA_DATE = _LATEST_DATE ) As mt_at     ON       mt_at.Activity_Group_ID = mt_ac.Activity_Group_ID     WHERE       _DATA_DATE = _LATEST_DATE ),     (     SELECT       appointment AS Engagement     FROM       `bigquery-public-data.utility_us.date_greg`     WHERE       Date Betwixt                        start_date                        AND                        end_date                        ) ) As base LEFT JOIN (   SELECT     Campaign_ID,     Activity_ID,     _DATA_DATE Every bit Date,     COUNT(*) As count,     COUNT(Distinct User_ID) Equally du   FROM     `dataset.activity_campaign_manager_id`   WHERE     _DATA_DATE Between DATE_ADD(CURRENT_DATE(), INTERVAL -31 DAY)     AND DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)   GROUP Past     Campaign_ID,     Activity_ID,     Appointment ) AS action ON   base.Campaign_ID = activity.Campaign_ID   AND base.Activity_ID = action.Activity_ID   AND base.Date = action.Date WHERE   base of operations.Campaign_ID IN                        campaign_list                        AND base.Activity_ID = activeness.Activity_ID ORDER By   base.Campaign_ID,   base.Activity_Group_ID,   base.Activity_ID,   base.Date'