Analytics Data Sources throwing Error | Community
Skip to main content
January 19, 2024
Solved

Analytics Data Sources throwing Error

  • January 19, 2024
  • 1 reply
  • 925 views

I am trying to upload data through API, however after successfully uploading data I am getting the following error message:

Notes The file could not be processed due to the following conditions: • Column header "meta_cost" is not a valid column header • Column header "meta_impressions" is not a valid column header • Column header "meta_reach" is not a valid column header • Column header "meta_clicks" is not a valid column header • Column header "meta_campaign" is not a valid column header • Column header "meta_adset" is not a valid column header • Column header "meta_ad" is not a valid column header • Column header "meta_objective" is not a valid column header • At least one enabled metric is required • At least one enabled dimension is required

 

Data Source Creation Query:

import requests url = "https://api.omniture.com/admin/1.4/rest/?method=DataSources.Save" headers = { "x-api-key": CLIENT_ID, "Authorization": "Bearer "+ACCESS_TOKEN, "Content-Type": "application/json" } payload = { "reportSuiteID": REPORT_SUITE_ID_STAGE, "dataSourceID": 2, "email": EMAIL, "name": "Meta Insights", "processing_type": "generic", "settings": { "allowOutOfOrderHits": True, "stopOnWarning": True, "metricNames": ["Meta_Cost","Meta_Impressions","Meta_Reach","Meta_Clicks"], "metricEvents": ["event801", "event802", "event803", "event804"], "dimensionNames": ["Meta_Campaign","Meta_AdSet","Meta_Ad", "Meta_Objective"], "dimensionVariables": ["evar180", "evar181","evar182","evar183"] } } response = requests.post(url, headers=headers, data=json.dumps(payload))

 Data Upload Query:

import requests url = "https://api.omniture.com/admin/1.4/rest/?method=DataSources.UploadData" headers = { "x-api-key": CLIENT_ID, "Authorization": "Bearer "+ACCESS_TOKEN, "Content-Type": "application/json" } payload = { "reportSuiteID": REPORT_SUITE_ID_STAGE, "dataSourceID": 2, "jobName": 'Meta Dummy Data Upload', "finished": True, "columns": ["Date","Meta_Cost","Meta_Impressions","Meta_Reach","Meta_Clicks","Meta_Campaign","Meta_AdSet","Meta_Ad", "Meta_Objective"], "rows": [ ["01/18/2024",'2000','2000','3000','200',"Test 1", "Test 2", "Test 3", "Test 4"], ["01/18/2024",'2000','2000','3000','200',"Test 5", "Test 6", "Test 7", "Test 8"] ] } response = requests.post(url, headers=headers, data=json.dumps(payload))

Data Source Summary:

Please suggest how to fix.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

I've not used this specific API, but I found some documentation that showed this as a sample:

"settings": { "allowOutOfOrderHits": true, "stopOnWarning": false, "metricNames": ["Searches"], "metricEvents": ["Event 1"], "dimensionNames": ["Internal search"], "dimensionVariables": ["Evar 1"] }

 

 

You are using:

"metricEvents": ["event801", "event802", "event803", "event804"],

 

Have you tried this?

"metricEvents": ["Event 801", "Event 802", "Event 803", "Event 804"],

 

 

https://developer.adobe.com/analytics-apis/docs/1.4/guides/data-sources/

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
January 20, 2024

I've not used this specific API, but I found some documentation that showed this as a sample:

"settings": { "allowOutOfOrderHits": true, "stopOnWarning": false, "metricNames": ["Searches"], "metricEvents": ["Event 1"], "dimensionNames": ["Internal search"], "dimensionVariables": ["Evar 1"] }

 

 

You are using:

"metricEvents": ["event801", "event802", "event803", "event804"],

 

Have you tried this?

"metricEvents": ["Event 801", "Event 802", "Event 803", "Event 804"],

 

 

https://developer.adobe.com/analytics-apis/docs/1.4/guides/data-sources/

January 20, 2024

@jennifer_dungan It did work. Thank you!

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 20, 2024

Yay! I'm glad it worked.  Honestly, when I saw the spaces there I thought for sure it was a documentation error 😛  But it was still worth trying, and it turns out... yep, they do want spaces there.