Need to capture amount in currency event

Gold Contributor
Gold Contributor

Hi Team,

Following is my CODE:

var userAmount = $('.ember-view.ember-text-field.form-control.amount').val();
s.events="event1, event16";
s.pageName = "Payment Complete";
s.eVar13=amount;
s.t();

I am capturing amount transacted in varaible "userAmount" using jquery. Now i need to capture same amount in currency event (event16). Can any one tell be exact code which is need to be written.

The above code is written in jQuery onHandler 1.7 extension and scope is DOM ready.

Thanks in advance.

 

8 REPLIES 8

Need to capture amount in currency event

Tealium Expert
Tealium Expert

Hi

with no context around this, i doubt you are going to get a reply that will be helpful. 

Can you expand on this. 

Tag tech

Circumstance

use case 

etc...

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -

Need to capture amount in currency event

Gold Contributor
Gold Contributor

I am tracking payment journey. There are 4 steps, in the last step i am capturing the "amount" transacted by user. I am able to capture the currency value (picking value from the form when user submit) in an evar. Now i want to put this value in currency event as well. I have written the code above which i am using in my extension (jQuery Handler).

Can any one help me how to put the amount value in currency event.

Need to capture amount in currency event

Tealium Expert
Tealium Expert
ok, whats the currency event?

is this a utag.link you are generating to trigger an event tag to fire?
Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -

Need to capture amount in currency event

Gold Contributor
Gold Contributor

Hi @parth_gupta199 ,

Tyr using the below code, to capture the value of currency event,

var userAmount = $('.ember-view.ember-text-field.form-control.amount').val();
var currencyEvent = "event1, event16=" + userAmount;
s.events = currencyEvent;
s.pageName = "Payment Complete";
s.eVar13=userAmount;
s.t();

 

Need to capture amount in currency event

Gold Contributor
Gold Contributor
 

Need to capture amount in currency event

Tealium Expert
Tealium Expert

Hi @dragooonvj 

By directly calling the s.t() or s.tl() methods you're breaking out of Tealium control and interacting directly with the AA code. While this can be useful, in most cases it just gets confusing.

It is probably better to manually call a utag.view() (for s.t) or utag.link (for s.tl) and then let the AA tag toolbox work out which events to fire.

So if you want to fire evar13, event1 and event16, set up mappings for that dimension and metrics in the AA tag, and then assign the appropriate data layer values and pass in to the utag.link call.

For example:

- create a data layer object called userAmount
- map userAmount to evar13 and event13 (as a value event) in the toolbox
- where ever it is you have your code calling s.t, replace that iwth something like:

utag.link( { link_name : "Fire Currency Event", userAmount :$('.ember-view.ember-text-field.form-control.amount').val() } );

That will then trigger the AA tag with a custom link name and the value for userAmount, which should then get mapped to your AA call.

Hope that helps

Need to capture amount in currency event

Gold Contributor
Gold Contributor
I accept with your point. Interacting directly with AA through extension is not recommended, which may be confusing to other user.

Need to capture amount in currency event

Tealium Expert
Tealium Expert
Ahh this all makes sense now, not entirely familiar with AA, as not had the opportunity to implement. tick box for something new learned today :-)
Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -
Public