Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit is happening now. Discover what's next in customer experience.
SOLVED

getVisitStart is not a function

Avatar

Level 1

In Configure Tracker Using Custom Code I have:

var s_visitStart = s.getVisitStart('sc_visit_start');

This throws the error:

Uncaught (in promise) TypeError: e.getVisitStart is not a function.

getVisitStart is a supported plugin according to appmeasurement documentation.

1 Accepted Solution

Avatar

Correct answer by
Level 4

I was getting the same error due to confusion over where to place the plugin code.  In short, the actual plugin code should be outside of the do

s.getVisitStart=newFunction(...);

s.usePlugins=true;

s.doPlugins=function(s) {

  // usage here

  var s_visitStart = s.getVisitStart('sc_visit_start');

}

Can't Get Analytics Plugins Working

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

I was getting the same error due to confusion over where to place the plugin code.  In short, the actual plugin code should be outside of the do

s.getVisitStart=newFunction(...);

s.usePlugins=true;

s.doPlugins=function(s) {

  // usage here

  var s_visitStart = s.getVisitStart('sc_visit_start');

}

Can't Get Analytics Plugins Working