I’m trying to create custom channel assignments in Google Analytics 4 based on specific URL patterns. My affiliate partners don’t follow standard UTM parameter conventions, so I need an alternative approach.
Incoming traffic from partners arrives with URLs like this:
https://www.example-store.com/?partner_id=98765-1-ABCDEF123&source=partner-site.com
I want to implement this rule:
IF URL includes "partner_id"
Then categorize as “affiliate” channel.
What’s the best way to configure this type of URL-based channel grouping in GA4? I used to handle this differently in Universal Analytics but can’t locate similar functionality in the new interface.
To set up your custom channel grouping in GA4, navigate to Admin > Property > Data Settings > Channel Groups. You can either create a new channel group or modify the existing one. Use the condition ‘Page location’ contains ‘partner_id’ to categorize it under your affiliate channel. Be cautious, as this could inadvertently include internal traffic if users have bookmarked such URLs. To mitigate this, consider adding a condition where ‘Session source’ does not equal ‘(direct)’. Remember that these adjustments will only affect incoming data moving forward, not past data.
just go to admin > data streams, add a condition with “page location” to include “partner_id” and name it affiliate. keep in mind data can take a while to show up, usually up to 24 hours.
I ran into the same issue with weird tracking parameters from different partners. The other answers got the GA4 location right, but they missed something crucial. You need to put your affiliate channel rule ABOVE the default channel definitions. GA4 reads these top to bottom, so if your affiliate rule sits below organic search or referral rules, those will grab your traffic first. Found this out the hard way when all my affiliate traffic kept showing up as referral traffic. Also, if you’ve got multiple partner URL formats, use regex patterns instead of making tons of separate rules. Changes kick in right away, but historical data stays the same - you’ll have to wait for fresh sessions to see it work.