Highlighted

I'm getting a Visitor is not defined error in visitorapi.js

Avatar

Avatar

andym95330655

Avatar

andym95330655

andym95330655

02-10-2017

Hi,

I'm trying to to implement visitorapi.js outside of DTM and I'm getting the following error:

VisitorAPI.js:6 Uncaught ReferenceError: Visitor is not defined

    at Object.<anonymous> (VisitorAPI.js:6)

    at Object.n.3../ChildVisitor (VisitorAPI.js:7)

    at r (VisitorAPI.js:1)

    at e (VisitorAPI.js:1)

    at VisitorAPI.js:1

I've copied the code in the implementation guide at the end of the .js file per instructions.  Any ideas what could be causing the error?

Replies

Highlighted

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

03-10-2017

Is you website deploying DTM for other solutions, or is DTM not deployed on your site at all? Is there a URL that can be shared here so we can view your implementation and the errors in the console?

Also, can you link to the the implementation guide you used?

Thanks,
Jantzen

Highlighted

Avatar

Avatar

andym95330655

Avatar

andym95330655

andym95330655

04-10-2017

We're not using DTM at all.  Unfortunately, the link is in our QA environment and there's not a good way to access it.  I can send the visitorapi.js if that would be helpful.  Here's the link to the implementation guide: Implement the Marketing Cloud ID Service for Analytics

Highlighted

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

04-10-2017

Yes, please send me a copy of your VisitorAPI.js file and your AppMeasurement.js file. Also, if you could include a screenshot of the console where you receive this error, that would be helpful.

Thanks,
Jantzen

Highlighted

Avatar

Avatar

andym95330655

Avatar

andym95330655

andym95330655

05-10-2017

Is there a way to attach files in the forum?

Highlighted

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

05-10-2017

Try editing your original post. Replies don't allow for attachments, but the original post should allow for it. If that doesn't work, you could always use something like GitHub to host your code and link us to the repo.

Highlighted

Avatar

Avatar

andym95330655

Avatar

andym95330655

andym95330655

05-10-2017

Highlighted

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

05-10-2017

Were you able to also supply your AppMeasurement file?

I'd like to verify that Step 5 has been completed and

s.visitor = Visitor.getInstance("INSERT-MARKETING-CLOUD-ORGANIZATION ID-HERE");

Is shown in your AppMeasurement file.

Highlighted

Avatar

Avatar

andym95330655

Avatar

andym95330655

andym95330655

06-08-2018

We use Tealium as our TMS and the consultant who implemented Tealium put in a s_doPlugins extension. 

Here's a copy of the extension: visitorapi/s_doplugin.txt at master · andyma1991/visitorapi · GitHub

Highlighted

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

07-08-2018

Looking at the GitHub repo you posted, I don't see where the consultant implemented the following instructions:

Implement the Experience Cloud ID Service for Analytics