GET map function example

The adapter alias for the BigQuery adapter is GA4. It needs to be specified as the first argument in the GET map function.

The map rule with the GET map function shown below should be specified as a single line in the map rule editor.

The following is an example of a GET map function used to retrieve the initial five rows (-ROWLIMIT 5) of a report (-READMODE run_report) from the GA4 account. The authentication is done using the specified service account private key file (-CREDENTIALSFILE /tmp/creds/key.json).

The adapter logging is enabled at the verbose level (-TV), and since the adapter trace file was not specified, the default log file (m4ga4.mtr) is created automatically in the map directory.

The report is generated for the GA4 property with the id 123456789 as specified in the -GA4PROPERTY 123456789 command. The report captures the activeUsers and engagementRate metrics (-METRICS activeUsers,engagementRate), across the country and date dimensions (-DIMENSIONS country,date), and only for the first two days of the year 2024 (-DATERANGES '2024-01-01 2024-01-02').

GET("GA4","-CREDENTIALSFILE /tmp/creds/key.json -READMODE run_report -GA4PROPERTY 123456789 -DIMENSIONS country,date -METRICS activeUsers,engagementRate -DATERANGES '2024-01-01 2024-01-02' -ROWLIMIT 5 -TV")