Define Your Own Custom Logic
Introduction
The "Define Your Own" feature in HandL UTM Grabber v3 allows you to create custom logic for tracking and manipulating UTM parameters and other tracked fields. This powerful tool enables you to define conditional rules that create new parameters based on existing ones, giving you more control over your tracking and marketing efforts.
When to Use This Feature
Use the "Define Your Own" feature when you need to:
- Create new parameters based on existing UTM parameters or tracked fields.
- Implement complex tracking logic specific to your marketing campaigns.
- Customize parameter values based on certain conditions.
- Enhance your analytics by creating more detailed or specific tracking parameters.
How to Access the Feature
- Log in to your WordPress admin panel.
- Navigate to the HandL UTM Grabber settings.
- Click on the "Define Your Own" tab in the settings menu.
Features and Functionality
Creating Custom Logic
The "Define Your Own" tab allows you to create multiple custom logic rules. Each rule consists of:
- A condition based on an existing parameter
- A new parameter to be created when the condition is met
Available Fields
The feature uses all fields generated by HandL UTM Grabber
These fields include standard UTM parameters and additional tracked fields provided by the HandL UTM Grabber plugin.
Operators
You can use various operators to define your conditions:
These operators allow for precise control over when your custom logic should be applied.
How to Use the Feature
- In the "Define Your Own" tab, you'll see a table where you can add custom logic rules.
-
For each rule, follow these steps:
a. Select the parameter you want to base your condition on from the first dropdown.
b. Choose an operator from the second dropdown to define how you want to compare the parameter's value.
c. Enter the value you want to compare against in the text field.
d. In the "Then set" section, enter a name for your new parameter.
e. Enter the value you want to assign to this new parameter when the condition is met.
- You can add multiple rules by filling out additional rows in the table.
- Click the "Save Changes" button to apply your custom logic rules.
Examples
-
Campaign Source Tracking:
- If
utm_source
equals "facebook" - Then set "social_campaign" = "fb_promo" or
- If
utm_source
equals "facebook" - Then set "phone_number" = "5125005050"
- If
-
Content Type Flagging:
- If
utm_content
contains "video" - Then set "content_type" = "video_ad"
- If
-
Specific Campaign Tracking:
- If
utm_campaign
starts_with "summer2023" - Then set "seasonal_campaign" = "summer_promo"
- If
-
Excluding Certain Traffic:
- If
referrer
not_contains "ourpartner.com" - Then set "non_partner_traffic" = "true"
- If
-
Advanced Regex Matching:
- If
utm_term
matches regex "^(red|blue|green)product$" - Then set "color_category" = "primary_colors"
- If
How It Works
When a visitor comes to your site, the HandL UTM Grabber plugin checks these custom logic rules. If a condition is met, it creates a new cookie with the specified parameter name and value. This information is then available for your analytics tools and can be used in your marketing workflows.
Best Practices
- Use meaningful names for your new parameters to ensure they're easily understood in your analytics.
- Be cautious with regex operations, as they can be more resource-intensive.
- Regularly review your custom logic to ensure it's still relevant to your current marketing strategies.
- Test your logic thoroughly to make sure it's working as expected.
Limitations
- The custom logic is evaluated when the page loads, so it won't react to changes in UTM parameters without a page refresh.
- Be mindful of creating too many custom parameters, as this can lead to cookie bloat and potentially impact site performance.
Troubleshooting
If your custom logic isn't working as expected:
- Check that the parameter you're basing your condition on is being correctly set.
- Verify that your condition values are correct and watch for typos.
- Use your browser's developer tools to check if the new cookies are being set correctly.
- Ensure that your site visitors have consented to cookies if you're using GDPR compliance features.
By leveraging the "Define Your Own" feature, you can create a more tailored and powerful tracking solution that meets your specific marketing and analytics needs. This flexibility allows you to extract more value from your UTM parameters and other tracked fields, leading to more insightful data for your marketing decisions.