Search code examples
ruby-on-railsvanity

Adding custom user ID to Vanity's "track!" method


There's a Vanity metric that is tracked by a cronjob, long after the user has left the website.

How should I pass the user ID to the "track!" method to ensure that the conversion is handled properly?


Solution

  • You can pass an identity option to the track! method, as the documentation shows:

    track!(:click, :identity => 'user_id')