Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the google analytics part to work #23

Closed
neslo opened this issue Feb 3, 2015 · 3 comments
Closed

Can't get the google analytics part to work #23

neslo opened this issue Feb 3, 2015 · 3 comments

Comments

@neslo
Copy link

neslo commented Feb 3, 2015

I installed the gem and setup the google analytics part as specificed in the readme.

in config/application.rb i have got

config.middleware.use(Rack::Tracker) do
handler :google_analytics, { tracker: "U-XXX-X"}
end

and when i check the produced script then i get

ga('create', 'U-xxxxxx-X', {"cookieDomain":"auto"});

and not the expected

ga('create', 'U-xxxxxx-X', 'auto');

I am using rack-tracker 0.3.0 and rails 4.1.6 and ruby 2.1.3

Cheers,
Thomas

@kangguru
Copy link

kangguru commented Feb 4, 2015

hej, thats kinda strange ;)

config.middleware.use(Rack::Tracker) do
  handler :google_analytics, { tracker: "U-XXX-X"}
end

should produce:

ruby
ga('create', 'U-xxxxxx-X', {});

as there are no options set for the tracker

config.middleware.use(Rack::Tracker) do
  handler :google_analytics, { tracker: "U-XXX-X", cookie_domain: 'auto'}
end

will yield to

ga('create', 'U-xxxxxx-X', {"cookieDomain":"auto"});

which is not what you'r expecting but is semantically the same. its not completely covered in the documentation but you can see that this "style" is being used for "none".

the debug addon reveals the following:

idealiver

@neslo
Copy link
Author

neslo commented Feb 4, 2015

Hi Lars,

Thanks for your detailed response and it highlights the "problem" is me.

I had initially tested out

handler :google_analytics, { tracker: "U-XXX-X", cookie_domain: 'auto'}

to try and get it to match

ga('create', 'U-xxxxxx-X', 'auto');

which the google docs tells me to expect.

So it seems that i must not have cleared out my cache or something like that when I switched to

handler :google_analytics, { tracker: "U-XXX-X"}

So all is good at your end then.

Thanks,
Thomas

@neslo neslo closed this as completed Feb 4, 2015
@kangguru
Copy link

kangguru commented Feb 4, 2015

\o/

cool that everything worked out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants