Marketing Metrics Cookie Best Practices
1. Our Suggestion
We recommend creating your own persistent cookie on your marketing site to track these metrics. When the lead converts, you can provide this data to Cheddar for analysis. Learn more about how to leverage the Cheddar API to record your tracked marketing data.
2. Marketing Cookie Logic
Recording user marketing data at signup requires that marketing data be highly available at the time of signup. One way to implement this would be to generate and maintain a cookie with this data. There are numerous ways to implement such a cookie - we've developed best practices in PHP that you can use as a guide for your own implementation.
2.1 Google Analytics tagged link
This implementation is aided by the use of Google Analytics tracking cookies, but using Analytics isn't a requirement for using a similar methodology. The most accurate method of passing campaign data into this cookie would be to create a Google Analytics-compatible tagged link.
See http://support.google.com/analytics/bin/answer.py?hl=en&answer=... for instructions on how to create a Google Analytics-compatible tagged link for incoming links such as Google Adwords campaigns.
2.2 Setting Additional Fields
You can set the 'firstContactDateTime' and 'referer' fields using your programming language of choice. You can also pull firstContactDateTime from the Analytics 'utma' cookie if it already exists; which it would if a user visited your page before you implemented this logic.
We consider a marketing cookie 'baked' or complete if it contains the firstContactDatetime, referer, and tagged utm data. This is accomplished on the first visit if your links are tagged. The referer should default to 'direct'.
2.3 Utilizing the Google Analytics Cookie for Customers Arriving Via Direct Links, Referrals, and Organic Search
If you are using Google Analytics, the utm data is made available via the Analytics 'utmz' cookie that is available after your customer's first visit. This is important even if you are tagging your Adwords campaign links. The 'utmz' cookie is the easiest way to get utm field data for a customer who first reaches your site directly, through a referer link, or through organic search.
Complete PHP Code Sample
Below is a grab from the officially supported PHP wrapper for the Cheddar API. The wrapper makes this easy as pie. Just run the static method on every request (no overhead, promise) and you're done. The 'newCustomer' method in the wrapper will automagically add the marketing metrics from the cookie.
Finally, you have a 'baked' cookie ready to push marketing data values to Cheddar when your lead converts to a customer! Learn more about how to leverage the Cheddar API to record your tracked marketing data. As you accumulate data, Cheddar will help you make informed decisions about your marketing efforts.