Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump word-wrap from 1.2.3 to 1.2.5 in /gcp/cloud-functions/create-vm #34

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6fc9db4
Add functionality of restoring incremental performance snapshots
AVMarkin Mar 22, 2024
b99ef67
Remove reference to skan_postbacks from downstream change_history
AVMarkin Apr 15, 2024
336da84
Fix bug with incorrect initial load
AVMarkin Apr 15, 2024
14b93a0
Ensure that temp files are cleaned after run-local.sh script execution
AVMarkin Apr 15, 2024
ae8b78b
Avoid duplicated values for custom conversion split
AVMarkin Apr 16, 2024
1bf4464
Change conflicting name for skan schema input table
AVMarkin Apr 16, 2024
4868579
Validate that skan schema table does not conflict with reserved name
AVMarkin Apr 16, 2024
64cd73b
Update documentation on specifying iOS SKAN schema
AVMarkin Apr 17, 2024
369b6b3
Update dashboard replication and GCP requirements in README
AVMarkin Apr 17, 2024
2414a14
Remind users to join Google Group during initial start on GCP
AVMarkin Apr 17, 2024
c74b908
Add support for deleting incremental performance snapshots
AVMarkin Apr 17, 2024
f3ee6f4
Add support for working with SKAN values in API 15+
AVMarkin Apr 18, 2024
ed49c7d
Add option for upgrading application from GCP
AVMarkin Apr 18, 2024
19fd05d
Upload results of GCP install to Cloud Storage
AVMarkin Apr 19, 2024
51c0052
Add helper for accessing application logs on GCP
AVMarkin Apr 19, 2024
5e92cb9
Check whether user is a project owner during GCP install
AVMarkin Apr 22, 2024
10f25b2
Migrated to v16 version in run-local.sh
AVMarkin Apr 22, 2024
231c3f0
Include skan4 template variable into generated config
AVMarkin Apr 22, 2024
5204231
Add tests for google_ads_queries for different versions of APIs
AVMarkin Apr 22, 2024
36971a6
Add Github Actions for testing Ads queries under different api versions
AVMarkin Apr 22, 2024
2538d24
Add support for providing GCS based google-ads.yaml
AVMarkin Apr 23, 2024
2ce974f
Update Airflow example
AVMarkin Apr 24, 2024
e3c5aa0
Upload information on application run to BQ
AVMarkin Apr 24, 2024
09bfe7a
Bump requirements to gaarf 1.13.0
AVMarkin Apr 25, 2024
81b09dd
Bump word-wrap from 1.2.3 to 1.2.5 in /gcp/cloud-functions/create-vm
dependabot[bot] Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/test-google-ads-queries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Google Ads API queries

on:
push:
paths:
- '**/google_ads_queries/*.sql'
schedule:
- cron: "* 1 * * *"

jobs:
simulate-queries:
runs-on: ubuntu-latest
strategy:
matrix:
version: [14, 15, 16]
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./app/requirements.in
- name: Run test script
run: |
chmod a+x ./tests/test_google_queries.sh
./tests/test_google_queries.sh ${{matrix.version}}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ App Reporting Pack fetches all necessary data from Ads API and creates a central
- `performance_grouping_history`
- `ad_group_network_split`
- `geo_performance`
- `cannibalization`

## Prerequisites

1. [A Google Ads Developer token](https://developers.google.com/google-ads/api/docs/first-call/dev-token#:~:text=A%20developer%20token%20from%20Google,SETTINGS%20%3E%20SETUP%20%3E%20API%20Center.)

1. A GCP project with billing account attached
1. A GCP project with billing account attached; a person responsible for deployment of App Reporting Pack should have **OWNER** permissions to the project.

1. Membership in `app-reporting-pack-readers-external` Google group (join [here](https://groups.google.com/g/app-reporting-pack-readers-external)) to get access to the [dashboard template](https://lookerstudio.google.com/c/u/0/reporting/3f042b13-f767-4195-b092-35b94e0b430c/page/0hcO).

Expand Down Expand Up @@ -304,6 +303,8 @@ For more details on dashboard please refer to [how-to-replicate-app-reporting-pa

> **_IMPORTANT:_** After the dashboard is created you need to enable image previews, read details on how it can be done [here](docs/how-to-replicate-dashboard.md#enable-image-previews).

Once the dashboard is saved it's important that all its users have access to underlying BigQuery dataset. If it's not possible, you'll need to change data credentials for all datasources from *Viewer* to *Owner* (see details [here](https://support.google.com/looker-studio/answer/6371135)).


## Disclaimer

Expand Down
8 changes: 7 additions & 1 deletion app/assets/bq_queries/asset_performance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ WITH CampaignCostTable AS (
FROM `{bq_dataset}.video_orientation`
GROUP BY 1
),
ConversionMapping AS (
SELECT DISTINCT
conversion_id,
conversion_name
FROM `{bq_dataset}.app_conversions_mapping`
),
CustomConvSplit AS (
SELECT
C.date,
Expand All @@ -139,7 +145,7 @@ WITH CampaignCostTable AS (
{% endfor %}
{% endfor %}
FROM `{bq_dataset}.asset_conversion_split` AS C
LEFT JOIN `{bq_dataset}.app_conversions_mapping` AS ConversionMapping
LEFT JOIN ConversionMapping
ON C.conversion_id = ConversionMapping.conversion_id
GROUP BY 1, 2, 3, 4, 5
)
Expand Down
16 changes: 9 additions & 7 deletions app/config.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,34 @@ gaarf:
output: bq
bq:
project: YOUR-BQ-PROJECT
dataset: app_reporting_pack
dataset: arp
# Do not change API version manually
api_version: '13'
api_version: '14'
account:
- 'YOUR_MCC_ID'
customer_ids_query: SELECT customer.id FROM campaign WHERE campaign.advertising_channel_type
= "MULTI_CHANNEL"
params:
macro:
start_date: ":YYYYMMDD-91"
end_date: ":YYYYMMDD-1"
start_date: :YYYYMMDD-91
end_date: :YYYYMMDD-1
gaarf-bq:
project: YOUR-BQ-PROJECT
params:
macro:
bq_dataset: app_reporting_pack # Should be the same as in 'gaarf.bq.dataset' above
target_dataset: app_reporting_pack_output
legacy_dataset: app_reporting_pack_legacy
bq_dataset: arp # Should be the same as in 'gaarf.bq.dataset' above
target_dataset: arp_output
legacy_dataset: arp_legacy
skan_schema_input_table: YOUR_PROJECT.YOUR_DATASET.YOUR_SKAN_SCHEMA_TABLE
template:
cohort_days: 0,1,3,5,7,14,30
has_skan: 'false' # Change to 'true' is have SKAN schema
incremental: 'false' # Change to 'true' is you want to store performance data incrementally
scripts:
video_orientation:
mode: placeholders
skan_mode:
mode: placeholders
incremental: false # Change to true is you want to store performance data incrementally
legacy: true
backfill: true
2 changes: 1 addition & 1 deletion app/ios_skan/bq_queries/change_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ AS (
GROUP BY 1, 2
)
SELECT
CP.* EXCEPT(skan_postbacks),
CP.*,
IFNULL(S.skan_postbacks, 0) AS skan_postbacks
FROM `{target_dataset}.change_history` AS CP
LEFT JOIN SkanPostbacksTable AS S
Expand Down
2 changes: 1 addition & 1 deletion app/ios_skan/bq_queries/ios_skan_decoder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AS (
skan_event_value_high,
skan_event_value_mean,
skan_mapped_event
FROM `{bq_dataset}.skan_schema`
FROM `{bq_dataset}.skan_schema_input_table`
),
PreparedData AS (
SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ SELECT
segments.sk_ad_network_user_type AS skan_user_type,
segments.sk_ad_network_ad_event_type AS skan_ad_event_type,
segments.sk_ad_network_attribution_credit AS skan_ad_network_attribution_credit,
metrics.sk_ad_network_conversions AS skan_postbacks
{% if skan4 == "true" %}
metrics.sk_ad_network_total_conversions AS skan_postbacks
{% else %}
metrics.sk_ad_network_conversions AS skan_postbacks
{% endif %}
FROM campaign
WHERE
campaign.advertising_channel_type = "MULTI_CHANNEL"
Expand Down
2 changes: 1 addition & 1 deletion app/requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-ads-api-report-fetcher>=1.12.1
google-ads-api-report-fetcher[bq]==1.13.0
db-dtypes
pyyaml
google-api-python-client==2.80.0
Expand Down
Loading