stalwil
stalwil

Reputation: 125

How do i set an eVar value in Adobe Analytics?

I couldn't find an answer to my question anywhere so i decided to post it here.

So, we have eVar33 set up within adobe analytics, when someone submits a form on our website how do i set eVar33 equal to the email address field?

$("form").submit(function(){
    $("input#email").val(eVar33);
});

Upvotes: 0

Views: 1062

Answers (1)

Jenn
Jenn

Reputation: 410

I'm assuming you have an appmeasurement library (aka s_code) on your page. In that case, Crayon Violet is right, something like this is what you want:

$("form").submit(function(){ 
     s.eVar33 = $("input#email").val(); 
});

That will set the variable. To send it to Adobe, you need to fire either s.t() (for a page view) or, as is more likely the case for you, s.tl() (for things you want to track not associated with a page view- https://marketing.adobe.com/resources/help/en_US/sc/implement/function_tl.html and https://marketing.adobe.com/resources/help/en_US/sc/implement/link_variables.html.) I suspect in the end, you'd do something like this:

$("form").submit(function(){ 
     s.eVar33 = $("input#email").val(); 
     s.linkTrackVars="eVar33"
     s.tl(this,"o","form submitted")
});

Upvotes: 1

Related Questions