URL Redirects for Marketing Campaigns in Magento with Tracking in Google Analytics
This is a basic tutorial on how to set up redirects for marketing campaigns that can be trackable via Google Analytics
Build the URL with Parameters Google Analytics Can Detect
- Use the Google Campaign URL Builder Tool to generate a URL with Google Analytic UTM parameters
- Website URL is the page you wish the user to land on
- The campaign fields will populate in Google analytics and allow you to track this campaign’s performance in fine detail. Source is the only required field, but you may want to get into more detail.
Create the URL Rewrite in Magento
- Open the Marketing menu and choose URL Rewrites under SEO & Search
- Click Add URL Rewrite
- Create a new Custom URL Rewrite with the following settings:
- Choose the store view you want this applied to
- The Request Path is what the user types in such as https://trellis.co/summer_promo so the value will be summer_promo
- Target path will be the URL that generated from step one without the domain of your site, so we will use ?utm_source=newsletter&utm_medium=email&utm_campaign=summer_promo
- Redirect Type is either permanent or temporary. This helps search engines understand how it should record the redirect.
- Ensure the URL properly redirects
- Ensure the data populates in Google Analytics. You will find it under Acquisition > Campaigns