Hi support team, I am trying to send an event to m...
# support
a
Hi support team, I am trying to send an event to marketo via a custom activity. However, I keep getting the error
Copy code
{
  "response": "Primary Key value is invalid for the event",
  "firstAttemptedAt": "2023-09-26T21:56:24.764Z",
  "content-type": ""
}
I have followed the instructions here
m
Hey There! šŸ‘‹ Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Franklin, can you share the sample payload that you are sending? Do delete/hash any PII within the data.
a
Copy code
{
  "type": "track",
  "event": "property_search",
  "sentAt": "2023-09-26T22:07:08.347Z",
  "userId": 100140581,
  "channel": "server",
  "context": {
    "library": {
      "name": "rudder-analytics-php",
      "version": "2.0.1",
      "consumer": "LibCurl"
    }
  },
  "rudderId": "93d37e8d-f4a3-4e7f-90aa-40994c0005a9",
  "messageId": "723b4c8a-f5d2-415b-a12e-ed2fa4d3ebb6",
  "timestamp": "2023-09-26T22:06:44.000Z",
  "properties": {
    "userId": 100140581,
    "search_id": 1695765996237,
    "search_page": 1,
    "result_count": 42,
    "saved_filter": null,
    "search_query": "{\"quickList\":\"expired-listing\",\"quickLists\":[\"absentee-owner\",\"not-on-market\"],\"general\":{\"propertyTypeCategory\":{\"inList\":[\"Residential\"]},\"propertyTypeDetail\":{\"inList\":[\"Single Family\"]}},\"owner\":{\"ownerStatusType\":{\"inList\":[\"Individual\"]}},\"queryComponents\":{\"city\":\"shelby\",\"state\":\"OH\",\"mode\":\"city\"}}",
    "map_search_log_id": 5651285
  },
  "receivedAt": "2023-09-26T22:07:08.289Z",
  "request_ip": "35.165.56.47",
  "originalTimestamp": "2023-09-26T22:07:08.347Z"
}
f
In your marketo config in rudderstack did you map the event to the primary key? what does your custom activity object look like in marketo - what's the name and type of the primary key?
(I just went through this in the last two days, so maybe I can share what I've learned)
a
@average-london-33320 Hello friend šŸ™‚ - Like @few-orange-64845 double-check that you’ve created the activities in Marketo successfully and have the correct
Activity ID
values mapped in Rudderstack.
a
@adventurous-salesclerk-56973 hello there. Yeah, I think it’s the primary key issue. Not sure what’s up
a
This value is accurate in Rudderstack?
a
Yeah
a
Is the custom activity approved in Marketo?
a
Yeah
This is what I am getting:
Copy code
{
  "response": "Primary Key value is invalid for the event",
  "firstAttemptedAt": "2023-09-26T21:56:24.764Z",
  "content-type": ""
}
a
idk if it matters, but for the ā€œEvent Nameā€ in Rudderstack maybe try the exact API Name in Marketo. Based on that error there’s a disconnect between the name of the Event and the Primary Key that’s being used.
a
Copy code
{
  "type": "track",
  "event": "property_search",
  "sentAt": "2023-09-26T22:07:08.347Z",
  "userId": 100140581,
  "channel": "server",
  "context": {
    "library": {
      "name": "rudder-analytics-php",
      "version": "2.0.1",
      "consumer": "LibCurl"
    }
  },
  "rudderId": "93d37e8d-f4a3-4e7f-90aa-40994c0005a9",
  "messageId": "723b4c8a-f5d2-415b-a12e-ed2fa4d3ebb6",
  "timestamp": "2023-09-26T22:06:44.000Z",
  "properties": {
    "userId": 100140581,
    "search_id": 1695765996237,
    "search_page": 1,
    "result_count": 42,
    "saved_filter": null,
    "search_query": "{\"quickList\":\"expired-listing\",\"quickLists\":[\"absentee-owner\",\"not-on-market\"],\"general\":{\"propertyTypeCategory\":{\"inList\":[\"Residential\"]},\"propertyTypeDetail\":{\"inList\":[\"Single Family\"]}},\"owner\":{\"ownerStatusType\":{\"inList\":[\"Individual\"]}},\"queryComponents\":{\"city\":\"shelby\",\"state\":\"OH\",\"mode\":\"city\"}}",
    "map_search_log_id": 5651285
  },
  "receivedAt": "2023-09-26T22:07:08.289Z",
  "request_ip": "35.165.56.47",
  "originalTimestamp": "2023-09-26T22:07:08.347Z"
}
a
@average-london-33320 send a test event where the event name is
propertySearchBL_c
. I’d be curious to see if it’s actually expecting the API name. That, or create a new custom activity so that the API Name is
property_search
.
m
Catching up on this
Hi Franklin, are you seeing the error, I guess the docs imply that the RudderStack event name `property_search`⁣ should be mapped to the Marketo event name.
a
ā€œevent nameā€ = ā€œmarketo activity nameā€
m
Hey Franklin can we jump on a call to debug this?
a
yes
@shy-kite-21035 are you still able to sync regarding this?
m
I have setup a call for 6PM IST tomorrow.
a
thank you
m
Hi Franklin, I was able to get help from the team to understand the issue and get a resolution 1. So both the Marketo ID and the Marketo Primary Key should be sent to the destination 2. So the Marketo Primary Key can be anything. Say you just call it "m_key". So in the dashboard you will have a mapping like this`product_search -> m_key`⁣ 3. Then in the event your properties object you should send the "m_key" and map it to the value in Marketo. Sharing sample event below
Copy code
{
  "type": "track",
  "event": "property_search",
  "sentAt": "2023-09-26T22:07:08.347Z",
  "userId": 100140581,
  "channel": "server",
  "context": {
    "library": {
      "name": "rudder-analytics-php",
      "version": "2.0.1",
      "consumer": "LibCurl"
    }
  },
  "rudderId": "93d37e8d-f4a3-4e7f-90aa-40994c0005a9",
  "messageId": "723b4c8a-f5d2-415b-a12e-ed2fa4d3ebb6",
  "timestamp": "2023-09-26T22:06:44.000Z",
  "properties": {
    "userId": 100140581,
    "search_id": 1695765996237,
    "search_page": 1,
    "result_count": 42,
    "saved_filter": null,
    "m_key": "propertySearched",
    "search_query": "{\"quickList\":\"expired-listing\",\"quickLists\":[\"absentee-owner\",\"not-on-market\"],\"general\":{\"propertyTypeCategory\":{\"inList\":[\"Residential\"]},\"propertyTypeDetail\":{\"inList\":[\"Single Family\"]}},\"owner\":{\"ownerStatusType\":{\"inList\":[\"Individual\"]}},\"queryComponents\":{\"city\":\"shelby\",\"state\":\"OH\",\"mode\":\"city\"}}",
    "map_search_log_id": 5651285
  },
  "receivedAt": "2023-09-26T22:07:08.289Z",
  "request_ip": "35.165.56.47",
  "originalTimestamp": "2023-09-26T22:07:08.347Z"
}
The most important thing here is that you send this column in the event > properties The advantage of this mapping is that you can then send any other event with this "m_key" from your source and it will be sent to this marketo API
a
Still doesn’t work:
m
So in the "Map event name to Marketo primary key" Event Name - "property_search" Marketo Primary Key - "m_key" (Ideally this can be anything) However the event should have this key
Copy code
{

      "type": "track", 

       "event": "property_search",

        .....

        properties: {

            "userId": 101121212,

            "m_key": "propertySearched" // This is the actual API key in Marketo

            .......         

        }

}
Would love to jump on a call to see this in action
a
oh the event needs to be modified before tracking?
m
The (Marketo primary Key) property has to sent in the event. Yes ideally the event needs to be changed at the client's browser (So this may require a Code change) or from the user transformation.