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

Upgrade analytics #100

Closed
thomasmarshall opened this issue Aug 4, 2015 · 4 comments
Closed

Upgrade analytics #100

thomasmarshall opened this issue Aug 4, 2015 · 4 comments

Comments

@thomasmarshall
Copy link
Contributor

Should we update the google_analytics_tracking_code method to use the new style tracking code?

def google_analytics_tracking_code(*web_property_ids)
if web_property_ids.first.present? && add_tracking_code?
analytics_que = "['_setAccount', '#{web_property_ids.shift}'], ['_trackPageview'], ['_trackPageLoadTime']"
web_property_ids.each_with_index do |web_property_id, index|
account = (index + 98).chr
analytics_que << ", ['#{account}._setAccount', '#{web_property_id}'], ['#{account}._trackPageview'], ['#{account}._trackPageLoadTime']"
end
javascript_tag <<-JAVASCRIPT
var _gaq = _gaq || [];
_gaq.push(#{analytics_que});
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
JAVASCRIPT
end
end

@erino
Copy link
Member

erino commented Aug 4, 2015

I was thinking that we should remove the google_analytics_tracking_code method, it's not that hard to copy the code from Google. The add_tracking_code method is the timesaving part.

@thomasmarshall thomasmarshall changed the title Upgrade Upgrade analytics Aug 4, 2015
@thomasmarshall
Copy link
Contributor Author

Yep, I agree with that.

erino added a commit that referenced this issue Aug 5, 2015
It's not that hard to copy the code from Google. The add_tracking_code
method is the timesaving part.

Closes #100
@bensymonds
Copy link
Contributor

Can we just close this issue, given we have #101? I never really know what the best thing to do is when there's a PR covering an issue. It seems like the issue is now tracked by the PR, so we don't need the issue any more.

@erino
Copy link
Member

erino commented Sep 2, 2015

This is now covered in #101

@erino erino closed this as completed Sep 2, 2015
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

3 participants