Associating page hits with campaigns using query parameters¶
Mautic allows you to trigger specific campaigns based on query parameters in page URLs. This is useful when you want to use the same base URL for multiple campaigns but differentiate them using query parameters.
Info
We’re assuming you already have at least two campaigns set up in Mautic that you want to associate page hits with, and that you know how to use UTM tags previously.
Steps¶
- Go to the Campaign Builder for Campaign A.
- Add a "Visits a page" decision to the campaign.
- Set the URL to
https://example.com/my-page?utm_campaign=A*using the decided base URL, path, query parameter (e.g. utm_campaign) and value for Campaign A. - Repeat steps 1-3 for Campaign B, but set the URL to
https://example.com/my-page?utm_campaign=B*using the value for Campaign B. - Publish both campaigns.
Results¶
When a contact visitshttps://example.com/my-page?utm_campaign=A, it will trigger Campaign A. When a contact visitshttps://example.com/my-page?utm_campaign=B, it will trigger Campaign B.
If you want the page hit to trigger both campaigns regardless of query parameter, use https://example.com/my-page* for the "Visits a page" decision in both campaigns.
Success
Be very specific with your URL matching. Using just https://example.com*would match the rule and trigger for any page on that domain.