Installing with Google Tag Manager

Using Google Tag Manager to install Appcues can be a quick and easy way to get started with Appcues without having to push any new code. Getting started is pretty easy. There are two things we need to get done:

  1. Load the Appcues Javascript SDK into the page.
  2. Make sure Appcues.identify() is called.

Loading Appcues resources into the page

These first two items are pretty easy. We'll want to put the following lines into a tag (substituting your own account id for <YOUR_ACCOUNT_ID>):

<script src="//fast.appcues.com/YOUR_ACCOUNT_ID.js"></script>

Identifying your user to Appcues

Appcues depends on the Appcues.identify() call to pass a userId and other user properties when checking whether to show content on a page or not. If you're merely testing Appcues you can always hard-code these values in, such as adding the following to Tag Manager:

<script>   
    Appcues.identify('testUserId', {userName: 'Test Testerson'});
</script>

For a full implementation you'll need to send over an actual userId (at the very least) and ideally some additional user properties (email, role, account status, created date, etc). To do this through Tag Manager you'll need to leverage Tag Manager Variables (see  here) and pass those into the identify call:

<script>   
    Appcues.identify(<USER_ID_VARIABLE>, {<USER_PROPERTY_VARIABLES>});
</script><br>

For Single Page Applications you will need to add a call to Appcues.start() for any URL changes:

And that should do it! To test your installation after publishing, login to your site, open the browser console and enter 

Appcues.debug()

This will give you some diagnostic feedback on how Appcues is setup and what data is being sent. Check out the  Debugging document for full details on this feature. Go have some fun with it!

Still need help? Contact Us Contact Us