Expand my Community achievements bar.

SOLVED

DTM: Help with Custom Script to not Fire Page Load Rule on Pages with Specific URL Params

Avatar

Level 2

Hi all,

I am not a coder and need help writing a custom script that would not fire a specific page load rule for any page with "version=flim" or "version=flam" being passed in the url. Once I'm able to do that, I will create separate page load rules for the excluded pages.

The page load rule contains the same path as the pages I want to exclude from the rule (path="search-results"). The pages I want to exclude pass these variables in the URL ("version=flim" or "version=flam").

I've managed to set the "custom" criteria in the "Conditions>Rule Conditions" section of the page load rule where I want to exclude the other pages (see attached). But that's as far as I've gotten.

Help me write this custom code, Obi Wan. You're my only hope. 

Thank you for any help y'all can provide.

Sincerely,

- Jon

1 Accepted Solution

Avatar

Correct answer by
Level 2

Okay, I accomplished this by selecting

Conditions>Rule Conditions>Criteria=Path

In the subsequent section that loaded, I selected "exclude" in the drop-down menu and entered "version" in the text box. I also enabled Regex. 

This meant that this rule will not fire on any screen that contains "version" as a parameter in its URL.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

Okay, I accomplished this by selecting

Conditions>Rule Conditions>Criteria=Path

In the subsequent section that loaded, I selected "exclude" in the drop-down menu and entered "version" in the text box. I also enabled Regex. 

This meant that this rule will not fire on any screen that contains "version" as a parameter in its URL.