An analytic rule is a defined series of actions based on conditions. If the conditions evaluate as successful/true, actions for reporting, redirecting or blocking are applied.
Visitor Traffic and Analytic Rules is a powerful feature through which you can:
- Classify and group your traffic based on rules you define, giving you customized visitor data and analytic reports
- Log Search Engines that are not already specified
- Create customized spider rules for reporting spider visits, redirecting spiders when necessary and managing bandwidth usage and costs arising from spider traffic
- Mark visitor sessions as suspect for reporting
- Redirect page requests
- Block Requests from fraudulent visitors and manage bandwidth usage and costs
Types of Rules: Admin Rules and User Rules
Admin Rules are created by Spark Pay online stores to setup commonly used rules for anlytics and reporting such as classifying visitor data from known Search Engines, Spiders and Feeds. User Rules are rules created by storeowners and are site specific. They are run after Admin Rules and hence can override Admin Rules.
Things such as handling ad code commissions or logging spiders still happens as usual after the rules have run. The outcome of the rules can effect some of this, depending on what data gets written to the session.
Components of a Rule: Conditions and Actions
The following conditions can be used:
- Ad Code – Checks the incoming AdCode against a defined value to see if it matches. Can be set to * to match any value.
- Affiliate Code – Checks the incoming Affiliate Code against a defined value to see if it matches. Can be set to * to match any value.
- Blank Source – Checks to see if the source is blank. This can be used at the end of a set of rules to set a default or undefined source.
- IP Address – Checks against the IP address on the session, adheres to wildcard matching (i.e. 192.168.*.* or 10.*.1.*, etc.)
- Pay Per Click Keywords – Checks the incoming Pay Per Click keywords for a defined value, or if set to * matches any value. Can restrict this to be from a certain origin as well (default is Any, currently supported are Google, Yahoo, and MSN).
- Query String – Checks the query string of the request for variables such as feed=, and can match against a defined value. * matches any value. Includes a flag for exact match.
- Referring Domain – Checks for a defined mask against the referring domain, includes a flag for exact match. (i.e. “.google.”).
- Search Phrase – Checks the search phrase on the referrer for a defined value. * matches any value. The query variable that contains the search string must be specified. Includes a flag for exact match.
- Store – Checks to see if the session belongs to a specified store. This is supported for multiple store. Microstore are not supported as yet.
- User Agent – Checks the user agent, which is the identifier for the browser/program accessing your site, for a specified value, includes a flag for exact match.
The conditions can be evaluated on an ANY or ALL basis. An ANY will pass if any 1 of the conditions are matched and will perform the actions set. An ALL match requires ALL conditions to match before running the action.
Each rule can contain one or more of those conditions. Depending on the conditions set, if the rule is successful, then all of the actions set on the rule will apply.
The following Actions can be applied:
- Log Search Engine – Logs the visit as coming from a search engine, along with the engine’s name and search query.
- Mark Suspect – Marks the session as suspect.
- Set Source – Sets the source to the specified text value.
- Set Source Group – Sets Source Group, to the specified text value. This is a grouped field used to group multiple sources that have a common more general source (such as “Google" being the source would have "Search Engine" as the Source Group, or Shopzilla would have the "Comparison Engine" group). This allows you to see your primary sales channels on reports.
- Set Spider – Flags the session as a spider, when a session is flagged as a spider no session is stored, only the bare identifying information to save valuable SQL storage processing and space. Additionally, a spider cannot check out or log in to your site protecting your data.
Rules are loaded when a session starts and currently cached for 5 minutes, or until the rules are next updated via the admin console.
How To Setup Rules:
Browse to Tools > Power Features > Rule Engine > Visitor Traffic & Analytics.
Select User Rules, you can edit an existing, or create a new one from here.
Define the Rule:
- Name the Rule
- Define Conditions and use the '+' symbol to add conditions. You can add multiple conditions and set for the rule to be successful if any or all conditions are met.
- Define Actions and use the '+' symbol to add actions. You can add multiple actions to be run when condition/s are met.
Note: By Default Rules are sorted alphabetically and run and apply in the exact order that they are listed. Since rules override each other, the last rule overrides any previous rules. If you have a condition that evaluates as true for two separate rules and the Action is the same field (example setting a Source or Source Group), the last rule overrides any other preceeding it. You can use the Sort Order to define which rule should apply.
Check out these other articles on the Rule Engine: