> For the complete documentation index, see [llms.txt](https://resources.gamanzaengage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.gamanzaengage.com/other-topics/big-query-integration.md).

# Big Query Integration

### BigQuery Integration to CRM&#x20;

This new feature will allow you to create advanced segmentation in CRM, as CRM will be able to pull data from BigQuery's cloud warehouse configured by each operator, where predictive models can be created to target specific players when creating campaigns.

This feature will give you a wide array of options for segmentation and targeted campaigns, including building churn prevention models or player-specific bonus campaigns where multiple bonuses can be triggered within the same campaign to different players.

Please note, a BigQuery Google cloud account must be used in order to connect to CRM.

*\*Note: all BigQuery segments act as dynamic, real-time segmentation, so all campaigns will be sent to the appropriate audience at all times.*

### BigQuery Applications

Some of BigQuery's applications in marketing and communication efforts include:

#### **Churn Prevention Model**

BigQuery may be used to create advanced segmentation to handle players at risk of churn with varying degrees of inactivity. You can establish a model where players are placed in categories based on an inactivity timespan, and the CRM can then pull the data to trigger specific campaigns based on real-time input regarding player behavior.

#### **Multiple Bonus Campaigns**

Different bonuses can be configured to be sent to specific players within the same campaign. This can enhance the user experience by tailoring bonuses to each player profile, gaming taste or spending behavior.

BigQuery can be used to create dynamic segmentation fed in real time to determine a bonus role for each player, which can then be retrieved in CRM to create tailor-made campaigns where each player will receive a different bonus based on their role.

To create this segment, you must create bonus id and bonus trigger columns and name the columns *BonusId* and *TriggerBonus* on BigQuery. The bonus id must include the bonus id of a previously created bonus from your bonus engine, and the trigger type will be used for the bonus trigger.

### Creating a Segment using BigQuery

In order to use BigQuery integration to create an advanced segment, in the CRM, head over to the Segments Library and select **Create Segment.**

<figure><img src="/files/OUONkAgbvimZmxVbjTph" alt=""><figcaption></figcaption></figure>

#### **Step 1: Enter Details**

This first section will look exactly the same as any other segment being created. Enter a Segment name, and under Type, select **Big Query.** Tags and Description are optional fields.

<figure><img src="/files/BSjchpFb2LvGH8npYANb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HpN1QE3PMiWE5pNj48da" alt=""><figcaption></figcaption></figure>

When clicking on the 'i' icon next to the Type field, a bubble will display with further information on how BigQuery works.

#### **Step 2: Enter Query**

Here, you will be asked to input the query that will be used by the CRM to pull player information from the BigQuery database. The BigQuery data at this point has already been configured and fed by you (SQL editor knowledge is needed in order to fill out this field). It’s important to note the column must always include the player id in CamelCase = *playerId*.

<figure><img src="/files/3lDglchcgzFPyS53IweX" alt=""><figcaption></figcaption></figure>

Once the query has been input, hit **Run Query**. The system will display a Player Count for the chosen segment. Click on the Player Count button displaying the total number of players in the segment:

<figure><img src="/files/aBEW1mb7lUFeONpw4rZy" alt=""><figcaption></figcaption></figure>

A table screen will appear with a list of columns displaying the Player ID, bonus information and/or custom placeholders that may be used when building a campaign template. Custom placeholders are specific player data that don’t currently exist within CRM that might be used for marketing purposes within a campaign template.

The table screen will display as follows:

<figure><img src="/files/svCnlXu9VX9ATkmGcg5Y" alt=""><figcaption></figcaption></figure>

List of players with data columns. The list can be downloaded as an XLS document by clicking on the ‘Download As XLS' link at the bottom of the screen.

\*Note: On BigQuery’s end, in order to create custom placeholders, you must create additional columns with the custom data, with each column having the following structure: “CP.ExampleName”. Example = CP.FavoriteColor

Simply click on the copy icon next to each placeholder title to copy the code, and enter it in the campaign template to display the custom placeholder information:

<figure><img src="/files/1a7czwr8pgaLlLpzeKbZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/kEY35fK4sjvhWnd8Dow7" alt=""><figcaption></figcaption></figure>

### Linking a BigQuery Segment to a Campaign

In order to link a BigQuery segment to a CRM Campaign, here are the steps to follow:

**1) Fill Out the BigQuery database -** Enter the required player data in BigQuery(this is solely on your end)

**2) Create the BigQuery Segment -** Create the BigQuery segment under CRM > Segments > Create Segment

**3) Add the Segment to the Campaign -** Head over to Campaigns under CRM > Campaigns, and follow the regular process for creating or editing a campaign up until Step 3, where you will choose the previously created BigQuery segment from the segment list:

<figure><img src="/files/IgqKySYW0JXKjjd3fZjr" alt=""><figcaption></figcaption></figure>

**4) Complete the Campaign -** Complete the campaign creation process normally with the BigQuery segment. The campaign will now retrieve the data from BigQuery to dynamically send to the appropriate audience.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://resources.gamanzaengage.com/other-topics/big-query-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
