Expand my Community achievements bar.

Announcement: Calling all learners and mentors! Applications are now open for the Adobe Analytics 2024 Mentorship Program! Come learn from the best to prepare for an official certification in Adobe Analytics.

Data Source API - save

Avatar

Level 1

Hi,
I am creating a data source using API. I am encountering some error. below is my api assuming client id and access token is correct. Event1 is configured as "Registrations" and eVar1 is configured as "Channel"

 

curl -X POST "https://api.omniture.com/admin/1.4/rest/?method=DataSources.Save" \
    -H "x-api-key: xxx" \
    -H "Authorization: Bearer xxx" \
    -H "Content-Type: application/json" \
    -d '{
            "id": "1",
            "reportSuiteID":"xxx",
            "email": "xxx",
            "name": "xxx",
            "processing_type": "generic",
            "settings": {
                "allowOutOfOrderHits": true,
                "stopOnWarning": false,
                "metricNames": ["Registrations"],
                "metricEvents": ["Event 1"],
                "dimensionNames": ["Channel"],
                "dimensionVariables": ["Evar 1"]
            }
        }'

 

 error I am getting : 

Can someone help here metrics name is correct? Am I missing something here?

 

{
    "error": "Bad Request",
    "error_description": "invalid metric in metricEvents, should be a data sources metric or a custom event",
    "error_uri": null
}

 

 

2 Replies

Avatar

Community Advisor

This might sound silly, but have you tried using:

  • "event1" instead of "Event 1"
  • "evar1" or "eVar1" instead of "Evar 1"

 

I think the "name" fields are probably fine, but the actual metric and dimension references have to match exactly what Adobe is looking for, just like when you are sending data to Adobe via JS, you don't use:

 

s.events = "Event 1";

 

You use:

 

s.events = "event1";