Reply
Highlighted
Visitor
Posts: 73
Registered: ‎05-11-2016
Accepted Solution

Manual event calls for Tealium_Collect / Datahub / Audience Stream

Similar to how Google Analytics has it's measurement protocol for sending events, and allows custom/manual/automated events to be sent via that - is there a similar option for DataHub?  

I'm hoping a solution may be available that allows for faster processing of data than the omnichannel import, where instead of loading a file with 100k rows, I can run a script that makes 100k server calls ( with maybe a few milliseconds between each one?)

Otherwise the 1M omnichannel upload will be somewhat limiting for larger data sets and profile updates.

Reply
0 Kudos
Tealium Employee
Posts: 618
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Perfect!  Thanks Dan.

Reply
0 Kudos
Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@dan_george

I've tried using the code provided, and fixed a bug so the python code running is now the below - and i'm getting a 200 OK response - but i'm looking at the trace in DataHub and not seeing anything happening.

Also - i'm not seeing any authentication tokens anywhere - is this an open endpoint that doesn't require any kind of authentication other than account and profile name?

import httplib, urllib
params = urllib.urlencode({'data':{'event_name':'myEvent','cp.trace_id':'07244'},'event':'view'})
headers = {"Content-type": "application/json","Accept": "image/gif"}
conn = httplib.HTTPSConnection("collect.tealiumiq.com")
conn.request("POST", "/{myaccount}/{myprofiel}2/i.gif", params, headers)
response = conn.getresponse()
print response.status, response.reason
data = response.read()
conn.close()

Reply
0 Kudos
Tealium Employee
Posts: 618
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@Michael_Kim_shc

 

Can you try going to Discover > Live Events and checking if you see the event feed in there? I'm curious if the UDH isn't receiving the data at all, or if passing the Trace ID is incorrect.

 

I know for a standard GET call it works by passing in the query string so you may think about going that route (following examples at the top of the previously linked article) instead of a POST if you don't have to pass much data.

 

Regarding authentication, this is an open endpoint API.

Reply
0 Kudos
Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Going through the live Events view is going to be rather unwiedly because of the amount of live traffic.  Unless there's a way to filter that view?

Reply
0 Kudos
Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Arg.  nevermind I see the add stream by trace now..

Reply
0 Kudos
Tealium Employee
Posts: 618
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@Michael_Kim_shc you can also take an existing data variable and pass through a unique value like "page_name":"sundayfunday"

Reply
0 Kudos
Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Still seeing anything via trace ID, nor a couple different event Attributes I've tried.

Also - in the help doc code, i had to change the help doc code to:

conn = httplib.HTTPSConnection("collect.tealiumiq.com")

(instead of HTTP) and removed the https:// from the URL in order for python to parse.

Reply
0 Kudos
Tealium Employee
Posts: 618
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@Michael_Kim_shc I suggest you reach out to your Deployment/Account manage who can align you with an Engineer to help look into this further.

Reply
0 Kudos
Community Manager
Posts: 668
Registered: ‎08-26-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Hello @Michael_Kim_shc. I am trying to find your account manager now. Stay tuned...

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.
Reply
0 Kudos
Visitor
Posts: 8
Registered: ‎09-22-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

I am also trying to do a exact same thing. Were you able to solve this by contacting account manager and have an engineer look at it.

Also I had one questions about trace_id. Can the trace_id be any number or should I start one trace in UDH and for that trace I would POST data to the endpoint ?

Reply
0 Kudos
Tealium Employee
Posts: 23
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

[ Edited ]

Hey @aniket_mane, I believe you need to create a trace ID from the UDH and then pass that within the vdata call. From there you would then create a stream filtering for the trace ID and you can see the events flow in that way. If you are having difficulties please let me know what specifically is happening so I can investigate further or by all means use our support portal via https://support.tealiumiq.com.

Reply
0 Kudos
Tealium Employee
Posts: 312
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@aniket_mane Josh is correct - you must create the trace ID within the UDH console - it cannot be an arbitrary number. Additionally, the data source name that you pass on your vdata pixel must be "tealium_trace_id", not just "trace_id" e.g.

collect.tealiumiq.com/vdata/i.gif?tealium_account=myaccount&tealium_profile=myprofile&tealium_vid=myemail%40tealium.com&page_name=homepage&tealium_trace_id=53124
Ask me about using Tealium in mobile apps - Android, iOS, Windows, Cordova, Titanium, Ionic, or your framework of choice! I like a challenge ;-)
Visitor
Posts: 8
Registered: ‎09-22-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Thanks Josh.

Reply
0 Kudos
Visitor
Posts: 8
Registered: ‎09-22-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Thanks Craig. I will keep that in mind
Reply
0 Kudos
Visitor
Posts: 8
Registered: ‎09-22-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Hello All,

I tried doing this with the below steps

1) Started a new trace in AS UI
2) Used the POST Python code on site and did some modification based on this feedback on this post to get a 200 OK response. 
import httplib, urllib
params = urllib.urlencode({'data':{'event_name':'abc_score','tealium_trace_id':'09098','abc_score':'0.56','customer_id':'9999999'},'event':'view'})
headers = {"Content-type": "application/json","Accept": "image/gif"}
conn = httplib.HTTPSConnection("collect.tealiumiq.com")
conn.request("POST", "/<account>/<profile>/2/i.gif", params, headers)
response = conn.getresponse()
print response.status, response.reason
data = response.read()
conn.close()

​3) We did DISCOVER --> TRACE . Nothing is there . It just says LISTENING events. We did DISCOVER --> LIVE STREAM --> 0 events etc.

Could anyone help out here.

Thanks,
Aniket

Reply
0 Kudos
Visitor
Posts: 73
Registered: ‎05-11-2016

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

Have you tried starting a trace in chrome, doig someo web activity that gets included, (1 pageload), copy the network request sent to tealium-collect and replicate that request in your python?
If that works, then you can narrow down the difference in network calls (python vs web) until you find the offender.
Tealium Employee
Posts: 312
Registered: ‎09-01-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

@aniket_mane Apologies - I wasn't aware you were using the "POST" api - I thought you were using GET. Try changing "tealium_trace_id" to "cp.trace_id" and it should work (I just tested it myself). tealium_trace_id is the required variable name for the GET API (vdata), but it's different for POST.

Here's an example in JavaScript&colon;

var xhr = new XMLHttpRequest();
xhr.open('POST', "https://collect.tealiumiq.com/account/profile/2/i.gif", true);
var json_string = JSON.stringify({
"data": {
"cp.trace_id" : "01559",
"test" : "test"
},
"event" : "view"
});
xhr.send(json_string);
Ask me about using Tealium in mobile apps - Android, iOS, Windows, Cordova, Titanium, Ionic, or your framework of choice! I like a challenge ;-)
Visitor
Posts: 8
Registered: ‎09-22-2015

Re: Manual event calls for Tealium_Collect / Datahub / Audience Stream

[ Edited ]

Hi @craig_rouse and @Michael_Kim_shc,


We tried using "cp.trace_id" in Python but no success. The code gave 200 OK response but nothing in AudienceStream UI . In the DISCOVER --> LIVE EVENTS nothing was coming(it was saying LISTENING EVENTS). Then I started a trace using chrome extension and put the trace id from website . I visited website and did activities. We started seeing the visit events but not the event fired from our python code using vdata enrichment.

Is there any other way you tested it to make sure it worked even after getting 200 OK response ?

Thanks,
Aniket

Reply
0 Kudos