Include IER analytics JS on register-to-vote start page

Currently the IER team track analytics on the service itself, only getting the referer from the GOV.UK start page. 

They want to track the step before that, how someone got to the start page, any other GA params (like campaigns, search terms) so that a complete end to end flow of the service can be analysed. 

* This is a simplest-thing-that-works approach, manually targeting register-to-vote in the template, as we don't know enough to generalise custom service analytics yet.
* I've kept the custom code to a partial, to keep the format template clean
* IER are using Universal analytics, so there isn't a conflict with with the version of GA that GOV.UK uses. This is something we'll need to be aware of in the future.
* @bradleywright did the original testing with GA cross domain linking, i've squashed those commits into one, but not in to my work for more useful history

https://www.pivotaltracker.com/story/show/74213668

I'm not sure what the benefit of externalising it would be?

The GOV.UK account details are inline (
https://github.com/alphagov/static/blob/master/app/views/root/_google_analytics.html.erb)
and the account code is ultimately public anyway.


On 18 July 2014 15:21, James Abley <notifications@github.com> wrote:

> In app/views/root/transaction.html.erb:
>
> > @@ -35,6 +35,11 @@
> >       </div>
> >     </article>
> >    <%= render 'publication_metadata', :publication => @publication, :api_links => { 'application/json' => publication_api_path(@publication, :edition => @edition) } %>
> > +
> > +  <%# Enable cross-domain analytics for IER (register to vote) only - not generalised yet %>
> > +  <% if @publication.slug == 'register-to-vote' %>
> > +    <%= render :partial => 'transaction_cross_domain_analytics', :locals => { :ga_account_code => 'UA-23066786-5' } %>
>
> Should the GA account code be externalised?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/alphagov/frontend/pull/643/files#r15113134>.
>



-- 
*David Singleton*

Cabinet Office, Government Digital Service
Technical Lead, User Formats Team
david.singleton@digital.cabinet-office.gov.uk