Using Visited Pages conditional statement


(Emily) #1

Matrix Version: 5.2.4

Has anyone used the ‘Visited Pages’ conditional statement?

I am exploring using it for the first time, but am having inconsistent results.

I am testing it by getting it to show a piece of text if a specific asset has been visited. On one test it did show me this piece of test, when the specific asset was the immediately previous page. On every other test I have done to reproduce this, it has not show (i.e. failed).

I also am using on another page the %globals_visited_urls% keyword to output what URLs it thinks I have viewed - just for my own feedback. But this also seems to no output all the URLs I have visited in the site. It lists some, but not others. It lists the images & css files from the design file in addition to pages as well.

Not sure what is wrong with it? Or perhaps I have misunderstood the ability of the Visited Pages conditional statement?
Does it need to be connected to other tracking integrations? (e.g. Marketo) or can it work without?

Thanks,
Emily


(Bart Banda) #2

Are you using any kind of cache when you are testing this keyword? The list of visited pages in Matrix will only be populated with any requests that directly hit Matrix, so if you are using some sort of proxy cache such as Squid or other, then some requests might not be hitting Matrix at all.

You also might have unexpected results if you have Matrix caching on and you use the keyword in nested content that is set to cache.


(Emily) #3

Thanks Bart. I am not sure whether they are using Squid cache, I will have to ask.

For my testing, I wasn’t using any nested content, so at least I can rule that one out. But it is a good thing to keep in mind. :slight_smile:

If they are using Squid caching, I am guessing that this type of “if visited x-page, then do y-action” would be better handled with cookies / JS (which was hoping to avoid).


(Bart Banda) #4

There are actually some pretty decent JS libraries that do this for you that you could maybe use. One I’ve used before (not for page tracking though) was http://xoxco.com/projects/code/aware/