Google Analytics has the ability to set conversion goals based on URLs visited on your site. One goal that is commonly desired is getting users to register (and activate the membership) for your site. Activation links in ExpressionEngine are dynamically generated, but Google Analytics allows partial matching of URLs to set up a goal.
Table of Contents
- Find your activate_member Action ID
- Set a Google Analytics Goal for your activation URL
- Define Funnels including your member registration page
- Set the Match Type to “Head Match”
- Goal Value
- Put Google Analytics Tracking Code in Templates
Find your activate_member Action ID
The first step is to find the Action ID for account activation on your site. You can do this by either creating a user on your site, and looking at the URL in the activation email that you receive, or by looking in your database at the exp_actions table, looking for the activate_member method of the Member class. If you are looking at the activation URL in the email, the important part is in bold in the sample URL below, where the number 8 represents your Action ID for membership activation:
http://www.example.com/index.php?ACT=8&id=9QjL244na4
Set a Google Analytics Goal for your activation URL
Go to the create goal page for your domain in your Google Analytics account. Enter the partial URL with your Action ID above into the field “Goal URL” at the top of the page.
http://www.example.com/index.php?ACT=8
Give your Goal a name, and activate it.
Define Funnels including your member registration page
For the funnels, you can include whatever pathways are important to you, but you must include your membership registration page for accurate tracking.
http://www.example.com/index.php/member/register/
and if you use the Discussion Forum member profile page, do not forget
http://www.example.com/index.php/forums/member/register/
Set the Match Type to “Head Match”
In order for Google Analytics to properly match the URL, you must select “Head Match”. This allows Google Analytics to count your goal URL as a match, even though your users will be visiting the URL with the dynamic id portion.
Goal Value
The Goal Value will be something that you determine the value of a member registration to be, which Google Analytics will use in reports and to calculate your return on investment.
Put Google Analytics Tracking Code in Templates
Do not forget to put your Google Analytics tracking code in your templates that you wish to be tracked. For the example presented here, that would also include your member profile templates and your User Message template in Admin > Specialty Templates.
Category:HowTo Category:Statistics
