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
BedrockMission!

Learn More

View all

Sign in to view all badges

clearvar() is not working

Avatar

Avatar
Validate 1
Level 1
guidov61672237
Level 1

Like

1 like

Total Posts

15 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
guidov61672237
Level 1

Like

1 like

Total Posts

15 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
guidov61672237
Level 1

25-08-2016

Hello,

We've implementend dtm on an SPA. In the condition of every rule we have the following script

var s = _satellite.getToolsByType('sc')[0].getS();
s.clearVars();
return true;

The strange thing is that for pages with load times with longer load times (more than 4 seconds) we get the following error and the rule will not fire:

SATELLITE: Condition for rule "AA: page load" not met. Error: Cannot read property 'clearVars' of null

How can we fix this problem?

*On each page load a rondomID is set in the dataLayer. We use this as trigger for the rule. (dataelementchanged)

Regards,

 

Guido

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

90 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

90 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

26-08-2016

Hi Guidov ,

The Root cause of the problem is that When the pages with load times (more than 4 seconds)   load, Actually the call to Event based rule is getting fired even before the Adobe Analytics "S" object is instantiated  and it is because of the fact that as the page Reloads the the datalayer Element Page Id is changed with random id and then "Data Element changed" event type which constantly polls data element value detects change in data element and the event based rule fires even before the s object is initialized.

Hence There is need to alter the way current implementation is done such that when the Page Is fully loaded then only the data layer element is set with Random ID

Thanks & Regards

Parit Mittal

Answers (0)