Install Chartsy on Ruby on Rails
Add the script to the application layout.
1Add the script to the application layout
Copy your snippet from Growth Attribution in the Chartsy sidebar: step 1 of Set up tracking has it with your site's public key, which is safe to expose:
<!DOCTYPE html>
<html>
<head>
<title>Your app</title>
<%= csrf_meta_tags %>
<script async src="https://chartsy.fra1.digitaloceanspaces.com/production/static/track.js"
data-key="ch_pk_..."
data-api="https://dashboard.chartsy.app/api/attribution"></script>
</head>
<body>
<%= yield %>
</body>
</html>If Devise or your marketing pages use a different layout, add it there as well - or move it to a partial (<%= render "layouts/chartsy" %>) and render that in each layout's head.
Using Turbo? Turbo swaps pages without a full reload, so the script runs once and keeps working - window.chartsy.identify() is still there after you navigate.
Visits, sources and signups are fully tracked. The one thing client-side navigation leaves out is the "pages before signup" journey, which only includes full page loads.
2Check it worked
Open your deployed site in a private window, then in Chartsy go to Settings → Domains and click View setup checklist on the site's row. "Add tracking snippet" flips to done as soon as the first visit lands - it is inferred from real traffic, so it confirms the snippet is firing, not just pasted.
Nothing arriving? View the page source and confirm the <script> tag is there with your real key. A blank or placeholder key is the most common cause.
Testing locally records nothing: the script ignores localhost and private IP addresses. Automated browsers (Playwright, Puppeteer, Selenium, headless Chrome) are ignored too, so automated tests won't show up in your reports.
3Track signups
The script now records where each visitor came from. To see which channels bring signups - and later revenue - tell Chartsy who signed up.
Other stacks: see all signup tracking guides.


