Highlighted

Push custom event into a tag

Anonymous
Not applicable
Anonymous
_tcaq.push(['captureIdentity', '<value>', '<identity-type>']);

how do insert this custom event into a tag 

  • <value> -this is a utag data

  • <identity-type> -text

    i tried doing this through javascript extension but getting an error
  • var x=b.customer_email;
    _tcaq.push(['captureIdentity',x, 'email'])
2 REPLIES 2
Highlighted

Push custom event into a tag

Tealium Expert
Tealium Expert

What error are you getting, @Anonymous?

What scope does the JS extension have?

For the rest of the answer I'm goign to assume you're getting a _tcaq is not defined error, and you have scoped your extension to the tag that creates and uses the _tcaq object...

 

Extensions run before tags, so if your _tcaq object is created by code in a tag then it won't be declared when the extension runs.

It's usually best to declare the variable first, something like:

var _tcaq = _tcaq || [];

that will use the existing object if it exists, and create a new array object if not.

Or you could scope the JS extension to "after tags" which should mean the object has been created by the time the code runs.

Push custom event into a tag

Anonymous
Not applicable
Anonymous
thats one error i corrected and the second is the to scope the extension to after tags .This solved my issue thanks