# 14.4 Create and configure a Google Cloud Function

## 14.4.1 Create your Google Cloud Function

Go to <https://console.cloud.google.com/>. Go to **Cloud Functions**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-cf388ac96d5206abf71670ba5d90ba7130abad72%2Fgcp1.png?alt=media)

You'll then see this. Click **CREATE FUNCTION**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-bf5f1b455d815678135c17843af5766b5980e655%2Fgcp2.png?alt=media)

You'll then see this.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-72d5d80259d9b79cb7d46c0eceec414206b58634%2Fgcp6.png?alt=media)

Make the following choices:

* **Function name**: `--demoProfileLdap---event-forwarding`
* **Region**: select any region
* **Trigger Type**: select **HTTP**
* **Authentication**: select **Allow unauthenticated invocations**

You should now have this. Click **SAVE**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9833e6dad39eeb93d28072758d2ccb40769d0bb3%2Fgcp7.png?alt=media)

Click **NEXT**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9a69be29d921221d3c0c3fc1ecb56a255d3a121e%2Fgcp8.png?alt=media)

You'll then see this:

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-4db9a7cc4685442f1b74fcb1bcdd4a026094199e%2Fgcp9.png?alt=media)

Make the following choices:

* **Runtime**: select **Node.js 16** (or more recent)
* **Entry point**: enter **helloAEP**

Click **ENABLE API** to enable **Cloud Build API**. You'll then see a new window. In that new window, click **ENABLE** again.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a49f3a23a47ac9da4050dd4c7c74509523158a5c%2Fgcp10.png?alt=media)

You'll then see this. Click **Enable**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b346a12977ae9cd0e04a1770ee13e48d20f7dc47%2Fgcp11.png?alt=media)

Once **Cloud Build API** has been enabled, you'll see this.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-037cd1bbb2f0f955fc989971d90c97c1c3edc8c9%2Fgcp12.png?alt=media)

Go back to your **Cloud Function**. In your Cloud Function Inline Editor, make sure you have the following code there:

```javascript
/**
 * Responds to any HTTP request.
 *
 * @param {!express:Request} req HTTP request context.
 * @param {!express:Response} res HTTP response context.
 */
exports.helloAEP = (req, res) => {
  let message = req.query.message || req.body.message || 'Hello World!';
  res.status(200).send(message);
};
```

Next, click **DEPLOY**.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5791a3f95491eb1faf6e6662720023c1574e5b80%2Fgcp13.png?alt=media)

You'll then see this. Your Cloud Function is now being created. This may take a couple of minutes.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8aab29f3b256ef93d99a4daaba9d350c9b53d700%2Fgcp14.png?alt=media)

Once your function is created and running, you'll see this. Click on your function's name to open it.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-aea9d8f9617e5cdeb5042eebe3486986570dd117%2Fgcp15.png?alt=media)

You'll then see this. Go to **TRIGGER**. You'll then see the **Trigger URL** which is what you'll use to define the endpoint in Launch Server Side.

![GCP](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-ded9f7ae72c174700992de26b5be92e704cbeec8%2Fgcp16.png?alt=media)

Copy the Trigger URL, which looks like this: **<https://europe-west1-dazzling-pillar-273812.cloudfunctions.net/vangeluw-event-forwarding>**.

In the next steps, you'll configure Adobe Experience Platform Data Collection Server to stream specific information about **Page Views** to your Google Cloud Function. Instead of just forwarding the full payload as-is, you'll only send things like **ECID**, **timestamp** and **Page Name** to your Google Cloud Function.

Here's an example of a payload that you'll need to parse to filter out the above mentioned variables:

```json
{
  "events": [
    {
      "xdm": {
        "eventType": "web.webpagedetails.pageViews",
        "web": {
          "webPageDetails": {
            "URL": "https://builder.adobedemo.com/run/vangeluw-OCUC",
            "name": "vangeluw-OCUC",
            "viewName": "vangeluw-OCUC",
            "pageViews": {
              "value": 1
            }
          },
          "webReferrer": {
            "URL": "https://builder.adobedemo.com/run/vangeluw-OCUC/equipment"
          }
        },
        "device": {
          "screenHeight": 1080,
          "screenWidth": 1920,
          "screenOrientation": "landscape"
        },
        "environment": {
          "type": "browser",
          "browserDetails": {
            "viewportWidth": 1920,
            "viewportHeight": 451
          }
        },
        "placeContext": {
          "localTime": "2022-02-23T06:51:07.140+01:00",
          "localTimezoneOffset": -60
        },
        "timestamp": "2022-02-23T05:51:07.140Z",
        "implementationDetails": {
          "name": "https://ns.adobe.com/experience/alloy/reactor",
          "version": "2.8.0+2.9.0",
          "environment": "browser"
        },
        "_experienceplatform": {
          "identification": {
            "core": {
              "ecid": "08346969856929444850590365495949561249"
            }
          },
          "demoEnvironment": {
            "brandName": "vangeluw-OCUC"
          },
          "interactionDetails": {
            "core": {
              "channel": "web"
            }
          }
        }
      },
      "query": {
        "personalization": {
          "schemas": [
            "https://ns.adobe.com/personalization/html-content-item",
            "https://ns.adobe.com/personalization/json-content-item",
            "https://ns.adobe.com/personalization/redirect-item",
            "https://ns.adobe.com/personalization/dom-action"
          ],
          "decisionScopes": [
            "eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjE0YzA1MjM4MmUxYjY1MDUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTRiZjA5ZGM0MTkwZWJiYSJ9",
            "__view__"
          ]
        }
      }
    }
  ],
  "query": {
    "identity": {
      "fetch": [
        "ECID"
      ]
    }
  },
  "meta": {
    "state": {
      "domain": "adobedemo.com",
      "cookiesEnabled": true,
      "entries": [
        {
          "key": "kndctr_907075E95BF479EC0A495C73_AdobeOrg_identity",
          "value": "CiYwODM0Njk2OTg1NjkyOTQ0NDg1MDU5MDM2NTQ5NTk0OTU2MTI0OVIPCPn66KfyLxgBKgRJUkwx8AH5-uin8i8="
        },
        {
          "key": "kndctr_907075E95BF479EC0A495C73_AdobeOrg_consent_check",
          "value": "1"
        },
        {
          "key": "kndctr_907075E95BF479EC0A495C73_AdobeOrg_consent",
          "value": "general=in"
        }
      ]
    }
  }
}
```

These are the fields that contain the information that needs to be parsed out:

* ECID: **events.xdm.\_experienceplatform.identification.core.ecid**
* timestamp: **timestamp**
* Page Name: **events.xdm.web.webPageDetails.name**

Let's go to Adobe Experience Platform Data Collection Server now, to configure the data elements to make that possible.

## 14.4.2 Update your Event Forwarding property: Data Elements

Go to <https://experience.adobe.com/#/data-collection/> and go to **Event Forwarding**. Search your Event Forwarding property and click it to open it.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-85f9e8fbea4cea603f8625257d720d0869df3877%2Fprop1.png?alt=media)

In the left menu, go to **Data Elements**. Click **Add Data Element**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-459aa4f391ffec7cfb0c749c0a5e6f4e94b359f4%2Fde1gcp.png?alt=media)

You'll then see a new data element to configure.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fdfda887230aed2f9e2f954a697deb9d46c1ef64%2Fde2gcp.png?alt=media)

Make the following selection:

* As the **Name**, enter **customerECID**.
* As the **Extension**, select **Core**.
* As the **Data Element Type**, select **Path**.
* As the **Path**, enter `arc.event.xdm.--aepTenantId--.identification.core.ecid`. By entering this path, you'll be filtering out the field **ecid** from the event payload that is sent by the website or mobile app into the Adobe Edge.

{% hint style="info" %}
In the above and below paths, a reference is made to **arc**. **arc** stands for Adobe Resource Context and **arc** always stands for the highest available object that is available in the Server Side context. Enrichments and transformations may be added to that **arc** object using Adobe Experience Platform Data Collection Server functions.

In the above and below paths, a reference is made to **event**. **event** stands for a unique event and Adobe Experience Platform Data Collection Server will always evaluate every event individually. Sometimes, you may see a reference to **events** in the payload sent by Web SDK Client Side, but in Adobe Experience Platform Data Collection Server, every event is evaluated individually.
{% endhint %}

You'll now have this. Click **Save**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6b5a31fdad94dca43ad6e3bbd8bdc07a9a4c7de7%2Fgcdpde1.png?alt=media)

Click **Add Data Element**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0c372418ee6c14f73760d2ff9b3ef13a17607df2%2Faddde.png?alt=media)

You'll then see a new data element to configure.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fdfda887230aed2f9e2f954a697deb9d46c1ef64%2Fde2gcp.png?alt=media)

Make the following selection:

* As the **Name**, enter **eventTimestamp**.
* As the **Extension**, select **Core**.
* As the **Data Element Type**, select **Path**.
* As the **Path**, enter **arc.event.xdm.timestamp**. By entering this path, you'll be filtering out the field **timestamp** from the event payload that is sent by the website or mobile app into the Adobe Edge.

You'll now have this. Click **Save**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5370e3221eae33aab1a43f77c2167d39a82c4a33%2Fgcdpde2.png?alt=media)

Click **Add Data Element**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0c372418ee6c14f73760d2ff9b3ef13a17607df2%2Faddde.png?alt=media)

You'll then see a new data element to configure.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fdfda887230aed2f9e2f954a697deb9d46c1ef64%2Fde2gcp.png?alt=media)

Make the following selection:

* As the **Name**, enter **pageName**.
* As the **Extension**, select **Core**.
* As the **Data Element Type**, select **Path**.
* As the **Path**, enter **arc.event.xdm.web.webPageDetails.name**. By entering this path, you'll be filtering out the field **name** from the event payload that is sent by the website or mobile app into the Adobe Edge.

You'll now have this. Click **Save**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8380fadbb0251a707d76e2cd235c2785d685c003%2Fgcdpde3.png?alt=media)

You now have these data elements created:

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-2943baf55dcc00e1bb3209e3a5d9c672d6614632%2Fde3gcp.png?alt=media)

## 14.4.3 Update your Event Forwarding property: Update a Rule

In the left menu, go to **Rules**. In the previous exercise, you created the rule **All Pages**. Click that rule to open it.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5ece0e9a23139c0cd3bd67830c81f18b919b27dc%2Frl1gcp.png?alt=media)

You'll then this. Click the **+** icon under **Actions** to add a new action.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e87aff7e8610ab40cafbcffe2395759a405adbeb%2Frl2gcp.png?alt=media)

You'll then see this.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9eb0e199d5ed6712bd7e931415fcb0a1ac5d29e8%2Frl4gcp.png?alt=media)

Make the following selection:

* Select the **Extension**: **Adobe Cloud Connector**.
* Select the **Action Type**: **Make Fetch Call**.

That should give you this **Name**: **Adobe Cloud Connector - Make Fetch Call**. You should now see this:

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-170a95c0a44be5cb6b23e7e66320fe7b4382a81c%2Frl5gcp.png?alt=media)

Next, configure the following:

* Change the request protocol from GET to **POST**
* Enter the URL of the Google Cloud Function you created in one of the previous steps which looks like this: **<https://europe-west1-dazzling-pillar-273812.cloudfunctions.net/vangeluw-event-forwarding>**

You should now have this. Next, go to **Body**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-028e7dccb42ed780c098c0835c6a30d9c6f5ef0a%2Frl6gcp.png?alt=media)

You'll then see this. Click the radio button for **JSON**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-69f92328577c4811c044c9b8eb146edce188a44f%2Frl7gcp.png?alt=media)

Configure the **Body** as follows:

| KEY            | VALUE              |
| -------------- | ------------------ |
| customerECID   | {{customerECID}}   |
| pageName       | {{pageName}}       |
| eventTimestamp | {{eventTimestamp}} |

You'll then see this. Click **Keep Changes**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-77acccd45fb9a52a896fae7e1c8b096463f7b219%2Frl9gcp.png?alt=media)

You'll then see this. Click **Save**.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-475b98d5540be3e4fdefa39a8ee517eacf230bc1%2Frl10gcp.png?alt=media)

You've now update your existing rule in a Adobe Experience Platform Data Collection Server property. Go to **Publishing Flow** to publish your changes. Open your Development library **Main** by clicking **Edit** as indicated.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-be1c09a8814096400de06f653f20bd0226d3c726%2Frl12gcp.png?alt=media)

Click the **Add All Changed Resources** button, after which you'll see your Rule and Data Element appear in this library. Next, click **Save & Build for Development**. Your changes are now being deployed.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-7d8d0c2bf4dc7cb2e538303b67ae13187af38c51%2Frl13gcp.png?alt=media)

After a couple of minutes, you'll see that the deployment is done and ready to be tested.

![Adobe Experience Platform Data Collection SSF](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-8df687359b21ff18671f77a703bf3a527118620d%2Frl14.png?alt=media)

## 14.3.4 Test your configuration

Go to <https://builder.adobedemo.com/projects>. After logging in with your Adobe ID, you'll see this. Click your website project to open it.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1f113c071919d66b9bb4e4b97d5284282e997b7a%2Fweb8.png?alt=media)

You can now follow the below flow to access the website. Click **Integrations**.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-90b71802742bd7e63b57d893018aa19265b77749%2Fweb1.png?alt=media)

On the **Integrations** page, you need to select the Data Collection property that was created in exercise 0.1.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5cf49094f77ead0a2e2ab5581e2799517999779a%2Fweb2.png?alt=media)

You'll then see your demo website open up. Select the URL and copy it to your clipboard.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-9cfc19bfac7a72c64f3e750663b79c2a4acc8723%2Fweb3.png?alt=media)

Open a new incognito browser window.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-48a8d19f45654fc4442dc4aad8b2a193b3f34d2f%2Fweb4.png?alt=media)

Paste the URL of your demo website, which you copied in the previous step. You'll then be asked to login using your Adobe ID.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1bb88b0513b9fac2ed6224499ac33da7d3b67d43%2Fweb5.png?alt=media)

Select your account type and complete the login process.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-fbf755c12242e86c6787bb213da12d99795bd476%2Fweb6.png?alt=media)

You'll then see your website loaded in an incognito browser window. For every demonstration, you'll need to use a fresh, incognito browser window to load your demo website URL.

![DSN](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-def68e96912fd147fc6d7c9c8278935f0a00fc87%2Fweb7.png?alt=media)

When you open up your browser Developer View, you can inspect Network requests as indicated below. When you use the filter **interact**, you'll see the network requests that are sent by Adobe Experience Platform Data Collection Client to the Adobe Edge.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e62e5818da367ccb5cd94312ea3af9b613dc9129%2Fhook1.png?alt=media)

Switch your view to your Google Cloud Function and go to **LOGS**. You should now have a view similar to this one, with a number of log entries being shown. Every time you see **Function execution started**, it means that incoming traffic was received in your Google Cloud Function.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-1eb6c02d50d315be2a8ceb182e57ec5eff7a2b53%2Fhook3gcp.png?alt=media)

Let's update your function a bit to work with the incoming data, and display the information that was received from Adobe Experience Platform Data Collection Server. Go to **SOURCE** and click **EDIT**.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-e52f73f091acf0f9318c171aaa95492c14a7139a%2Fhook4gcp.png?alt=media)

In the next screen, click **NEXT**.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-4f8d5ad85b5733dfdd7fa9cca8bb036cf9cbbbde%2Fgcf1.png?alt=media)

Update your code like this:

```javascript
/**
 * Responds to any HTTP request.
 *
 * @param {!express:Request} req HTTP request context.
 * @param {!express:Response} res HTTP response context.
 */
exports.helloAEP = (req, res) => {
  console.log('>>>>> Function has started. The following information was received from Event Forwarding:');
  console.log(req.body);

  let message = req.query.message || req.body.message || 'Hello World!';
  res.status(200).send(message);
};
```

You'll then have this. Click **DEPLOY**.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b0282942cb3686723c0230ce3d07d6b455fee2d2%2Fgcf2.png?alt=media)

After a couple of minutes, your function will be deployed again. Click your function name to open it.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a53b335b4b4904d94c3b98d48c17e45c0a700b6e%2Fgcf3.png?alt=media)

On your demo website, navigate to a product, like for instance **DEIRDRE RELAXED-FIT CAPRI**.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0d7daba22ee1129a562c5b33947e2663c889ed24%2Fgcf3a.png?alt=media)

Switch your view to your Google Cloud Function and go to **LOGS**. You should now have a view similar to this one, with a number of log entries being shown.

For every page view on your demo website, you should now see a new log entry pop up in your Google Cloud Function's logs, which shows the received information.

![Adobe Experience Platform Data Collection Setup](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-52a2dfecdff5a6b593ca224ca46615280146200b%2Fgcf4.png?alt=media)

You've now successfully sent data that was collected by Adobe Experience Platform Data Collection, in real-time, to a Google Cloud Function endpoint. From there, that data can be used by any Google Cloud Platform application, such as BigQuery for storage and reporting or for Machine Learning use cases.
