Sign in

How can we help?

Can I use the Freespee script in my single-page app?

Topic: , Updated:

Yes, but you will need to manually trigger an execution when a new page is loaded. This can be done using the trackPage method on the __fs_dncs_instance object.

In the root of your project add the snippet as usual but halt execution by adding the autoInvoke=false option.

<script type="text/javascript">
    var __fs_conf = __fs_conf || [];
    __fs_conf.push(['autoInvoke', false]);
<script type="text/javascript" src="//url/js/external/fs.js"></script>

On every page load (including the initial one) you then need to run __fs_dncs_instance.trackPage().

For example, if you're using AngularJS you would put it in the $viewContentLoaded event:['$rootScope', function($rootScope) {
    $rootScope.$on('$viewContentLoaded', function() {
Was this article helpful?
0 out of 0 found this helpful


Not the answer to your question?

Powered by Zendesk