How to record Visit ID in an eVar?

Avatar

Avatar
Validate 1
Level 1
barbara_posila
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
barbara_posila
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
barbara_posila
Level 1

15-10-2015

Hi,

Our client wants to record visit ID in an eVar and we were looking for some kind of solution. Is there any way to do this with dynamic variables? And if not, maybe the concatenation of Visitor ID + Visit Number would work (also through dynamic variables)?

We would really appreciate some help on that.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 1
Employee
jacobh35707634
Employee

Likes

28 likes

Total Posts

41 posts

Correct reply

31 solutions
Top badges earned
Ignite 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Ignite 1
Employee
jacobh35707634
Employee

Likes

28 likes

Total Posts

41 posts

Correct reply

31 solutions
Top badges earned
Ignite 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
jacobh35707634
Employee

15-10-2015

You are correct about s_vi being the visitor ID, this should stay the same for every visit (at least we hope so!). The visit ID (the visit number part) is calculated after the hit is collected so it isn't available through dynamic variables.

I think you can get what you are after using a combination of the visitor ID and visit number from the getVisitNum implementation plugin, http://microsite.omniture.com/t2/help/en_US/sc/implement/#getVisitNum

Instead of using the s_vi dynamic variable, I'd suggest reading the s_vi cookie directly, then reading the s_fid fallback cookie, and then doing something else if this fails (either don't set the variable so it reports as "None", or set it to something custom). That way you won't get an empty ID for visitors who aren't cookied.

var id = s.c_r('s_vi') != "" ? s.c_r('s_vi') : s.c_r('s_fid'); if (id != "") { var dt = new Date(); s.eVar1 = id + "|" + dt.getUTCMonth() + "|" + dt.getUTCFullYear() + "|" + s.getVisitNum(); } else { //do something else, user does not accept any cookies... }

This should result in something like:

4E39CEC3FE367A9A-178C79544A5B6A15|2|2014|1

4E39CEC3FE367A9A-178C79544A5B6A15|2|2014|2

You'll need to customize this more for your needs but it should get you going down the right path.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
barbara_posila
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
barbara_posila
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
barbara_posila
Level 1

15-10-2015

Hi JiMa,

I thought that the s_vi is the visitor ID and not the VISIT ID. Am I right? I've done some tests and it doesn't change from one visit to another.

Any other ideas?

Thanks a lot!

Avatar

Avatar
Give Back 5
Level 4
JillsMatthew
Level 4

Likes

28 likes

Total Posts

68 posts

Correct reply

23 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 1
Validate 10
View profile

Avatar
Give Back 5
Level 4
JillsMatthew
Level 4

Likes

28 likes

Total Posts

68 posts

Correct reply

23 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 1
Validate 10
View profile
JillsMatthew
Level 4

15-10-2015

Hi Barbara,

Did you try using s_vi to store SiteCatalyst cookie values?

e.g. s.propXX="D=s_vi"

This link provides more details of Dynamic Variables: http://adobe.ly/1fQfYa9