> For the complete documentation index, see [llms.txt](https://resources.less.tech/less-tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.less.tech/less-tech/exercises/data-driven-ecommerce/hints.md).

# Hints

We recommend that you try to complete as much of the exercise on your own after each step

### Hint #1

The first step is to input the data and summarize it by Year and Month. We do by first changing the date columns to a Datetime format in the Change Columns. Then, because they're now Datetime, we use a Date Format to create two new columns for each input - Monthname and Year. Finally, we use a Group By to **group** our data **by** the newly created monthname and year columns while **summarizing** the metrics we're interesting in and **counting** the orders from Shopify.

<figure><img src="https://1596277999-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSJL6Od4KuV8hrdCZbXp%2Fuploads%2FQ6mId0mB9c1pBLRO7YAZ%2FCleanShot%202024-03-13%20at%2018.13.00%402x.png?alt=media&amp;token=8302c1f5-d5ed-483b-a490-d88bbd56318e" alt=""><figcaption></figcaption></figure>

***

### Hint #2

The second step is about consolidating our three datasets into a single dataset. We use two Combine tools to do that. We choose left joins every time and our ID's are the respective Monthname and Year columns. The Combine is essentially looking in each dataset to find mathing ID and when it finds a pairs (e.g. monthname =April, year = 2022), add combines the columns into a single row.&#x20;

{% hint style="info" %}
The Combine tools is known as a vlookup or index/match in Excel, as a Join in SQL and as a Merge in Pandas
{% endhint %}

We also calculate the average order size with a Calculate tool on the Shopify data before combining.

<figure><img src="https://1596277999-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSJL6Od4KuV8hrdCZbXp%2Fuploads%2FpkPkg4nc00dG2nV6iEhB%2FCleanShot%202024-03-13%20at%2018.13.25%402x.png?alt=media&amp;token=489abb4b-0736-4601-bc0c-c479c389102a" alt=""><figcaption></figcaption></figure>

***

### Hint #3

The next step of our analysis is about Cost-Per-Click (**CPC**) and Click-Through-Rate (**CTR**) for our two marketing sources. We do that with Calculate tools and according to the definitions outlined in the [introduction presentation](https://app.gitbook.com/o/RcswY5TelREASsdLiDLX/s/aSJL6Od4KuV8hrdCZbXp/~/changes/38/exercises/data-driven-ecommerce#introduction-ecommerce)

<figure><img src="https://1596277999-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSJL6Od4KuV8hrdCZbXp%2Fuploads%2FZfO2y7kW8iLjGidM7N5K%2FCleanShot%202024-03-13%20at%2018.13.37%402x.png?alt=media&amp;token=801c289d-b17e-42b0-a76e-1974fa7979a2" alt=""><figcaption></figcaption></figure>

***

### Hint #4

The next and final step is the most complex. This is where we implement our ROAS formula. We'll explain how to do the Google Ads calculation here.&#x20;

<figure><img src="https://1596277999-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSJL6Od4KuV8hrdCZbXp%2Fuploads%2FK2CfGa6RQCD6BSpuRWh6%2FCleanShot%202024-03-13%20at%2018.13.48%402x.png?alt=media&amp;token=e04c94bc-3038-4326-ab83-065ad7bc114d" alt=""><figcaption></figcaption></figure>

The idea is to get an average of the last three months of Google Ads Spend. The idea is that we assume that our last three months spend has an effect in sales in this month. Below you can get a visual idea of what we're trying to achieve.

In the screenshot you'll see that we're doing a past 3 month rolling average of our Google Ads spend. So in the 4th row in the ga\_3month\_delay, we're getting an average spend of the last three months. You can see configuration of the first Running Interval tool on the left.

<figure><img src="https://1596277999-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSJL6Od4KuV8hrdCZbXp%2Fuploads%2FxsVhqRNmdeQMRFexjHcR%2FCleanShot%202024-03-14%20at%2009.11.30.png?alt=media&amp;token=b7a8f806-3aa4-443e-abf9-47326a4a74b2" alt=""><figcaption></figcaption></figure>

The final steps after the second Running Interval tool (tool ID 39) is to remove the first rows without any ROAS - we use a Filter to say that the month (not monthname, but month as a number (jan = 1, etc.)) - which you can create this all the way back in the Date Format - should be larger than 3 (i.e. after March). Finally we calculate our ROAS by dividing our sum\_order\_amount with ga\_3month\_delay + fb\_1month.

###
