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

Bug: Data Element storage duration and Data Element Changed rule

Avatar

Level 4

28-10-2019

Scenario:

On my page, I have a data layer declared like this:

var dataLayer = {

  page: {

    ...

  }

};

Notice that the dataLayer in my page doesn't have a "foo" key declared. This key is appended later through a script on the page.

Launch setup:

I have a data element declared like this:

Name: foobar

Type: JavaScript variable

Variable name: dataLayer.foo.bar

Storage Duration: Pageview

I have a rule declared like this:

Event type: Data Element Change

Data Element Name: foobar

Steps to reproduce:

1. Load the page where the dataLayer does not include a "foo" key.

2. Append the "foo" key to the dataLayer through a script later.

Expected result:

The Data Element Change rule fires.

Actual result:

The Data Element Change rule does not fire.

BUT....

Steps to reproduce (continued):

3. Change the Data Element's Storage Duration to "None".

4. Build the library.

5. Change the Data Element's Storage Duration back to is original "Pageview".

6. Build the library.

Actual result:

The Data Element Change rule fires.