Gets the number of keywords driving traffic to a profile between two dates.
* May be inconsistant with the website
Gets analytics data from Google Analytics to create custom reports for multiple clients and profiles.
=getGaKeywordCount(profileId, startDate, endDate)
This function gets the number of keywords that are driving traffic to a specific profile between two dates. It works by collecting all the keywords that drove traffic between the start date and end date and returning the total number of keywords.
Name | Type | Description |
---|---|---|
profileId |
Number | Profile ID from the Profile ID sheet |
startDate |
Date | Starting date |
endDate |
Date | Ending date |
Cells: A1: 12345678 A2: 11/01/2011 A3: 11/02/2011 =getGaKeywordCount(A1, A2, A3)
=getGaMetric(profileId, metric, startDate, endDate, optFilter, optDimensions, optSegment, optSort, optIncludeHeaders, optMax, optEnableSleep)
Gets analytics data by metrics and dimensions within a date range.
It will return an error if the date is in the future or if the start date is after the begining date.
Name | Type | Description |
---|---|---|
profileId |
Number | The ID number for the profile |
metric |
String | Google Analytics metric you want to get data for. Note You must add ga: if you're using multiple metrics in
on the same function. It's not required if you only use one metric.
Common metrics
|
startDate |
Date | Starting date |
endDate |
Date | Ending date Limitation Long date ranges may timeout with high traffic profiles. Try a shorter date range. Warning Long date ranges may result in sampled numbers. |
optFilter |
Filter | (Optional) Filter data from your results.
Available operators
|
optDimensions |
String | (Optional) Dimentions.
Available operators
Common dimensions
|
optSegment |
Number | (Optional) Segment ID |
optSort |
String | (Optional) Sort Known Bug Sorting doesn't work. You have to sort the data yourself. |
optIncludeHeaders |
Boolean | (Optional) Include headers (true or false) |
optMax |
Number | (Optional) Maximum rows |
optEnableSleep |
Number | (Optional) Slow down API calls (default is true) |
Cells: A1: 12345678 A2: visits A3: 11/01/2011 A4: 11/20/2011 =getGaMetric(A1, A2, A3, A4)
Cells: A1: 12345678 A2: visits A3: 11/01/2011 A4: 11/02/2011 A5: ga:medium==organic =getGaMetric(A1, A2, A3, A4, A5)
Cells: A1: 12345678 A2: visits A3: 11/01/2011 A4: 11/02/2011 A5: ga:medium==organic;ga:keyword==seo company =getGaMetric(A1, A2, A3, A4, A5)
Cells: A1: 12345678 A2: visits A3: 11/01/2011 A4: 11/02/2011 A5: ga:keyword==seo company,ga:keyword==philadelphia seo =getGaMetric(A1, A2, A3, A4, A5)
Cells: A1: 12345678 A2: visits A3: 01/01/2011 A4: 06/30/2011 A5: ga:month =getGaMetric(A1, A2, A3, A4, , A5, , , true) // Will return 6 rows, one per month, January to June.
Cells: A1: 12345678 A2: visits A3: 01/01/2011 A4: 12/31/2011 A5: ga:week =getGaMetric(A1, A2, A3, A4, , A5, , , true) // Will return 52 rows numbered 1 to 52 for each week in 2011 // Tip: If you want to convert the week number to a date, add this: D1: =getMonday(A3) D2: =D1+7 D3: =D2+7 D4: =D3+7 D5: .... and so on.
Cells: A1: 12345678 A2: visits A3: 01/01/2011 A4: 06/30/2011 A5: ga:city =getGaMetric(A1, A2, A3, A4, , A5, , , true)
Cells: A1: 12345678 A2: ga:visits,ga:transactions A3: 01/01/2011 A4: 12/30/2012 A5: ga:month,ga:year =getGaMetric(A1, A2, A3, A4, , A5, , , true)
Cells: A1: 12345678 A2: visits A3: 01/01/2011 A4: 03/30/2011 A5: ga:source,ga:referralPath =getGaMetric(A1, A2, A3, A4, , A5, , , true)
Cells: A1: 12345678 A2: ga:visits,ga:bounces A3: 01/01/2011 A4: 03/30/2011 A5: ga:medium==organic;ga:keyword=seo company A6: ga:month,ga:city =getGaMetric(A1, A2, A3, A4, A5, A6, , , true)