Google AdWords can be an essential part of your marketing strategy. In order to achieve the best performance while maintaining the integrity of your marketing data, you will need to do one simple change to your URL’s to make this happen.
As a best practice, you should always add a trailing slash to the end of your URL but before your GLCID code. For example:
GOOD:
http://domain.com/landing-page/?glcid=CMA56qe1ocdCFUccgAod3V8aDQ
BAD:
http://domain.com/landing-page?glcid=CMA56qe1ocdCFUccgAod3V8aDQ
Why add the trailing slash?
We are going to look at two different viewpoints on why this should be added. One in the eyes of a developer and the other in the eyes of a marketer.
Developer
As you may be aware, WordPress will automatically redirect a URL with no trailing slash to a URL with a trailing slash. You can see this by running the following curl statement:
curl -I http://wpengine.com/migrations
You will notice that the curl statement returns a 301 and redirects the user to the same page but with a trailing slash.
In our stack, we use varnish rules to drop gclid=foo in the backend for rendering because the values in that query parameter are always different but the content is always the same on the page. This allows us to cache the page and provide awesome performance. However, because of the 301 redirect, gclid is lost and now the marketing data is skewed.
If you return a 200 response code (by making sure the trailing slash is in place when a user clicks the link), the gclid query string can be used. This will allow for varnish to cache the data while allowing your marketing data to remain current.
Marketer
As mentioned before, WordPress will automatically redirect a URL with no trailing slash to a URL with a trailing slash.
As a marketer, you know speed is critical for SEO and overall user experience. By removing this redirect, you save precious time on the overall load of the page. In addition, a faster page load means you engage with your users faster, which leads to better conversion rates!
When setting up your AdWords, make sure to add the trailing slash to the URL so that this redirect can be avoided.