Google Tag Manager

Integrate Wondering easily on your website directly through Google Tag Manager.

📘

Google Tag Manager overview

Google Tag Manager (GTM) is a tool built by Google to help you add and manage code snippets on your website without needing to edit your website code directly. You can set it up quickly, and after you’ve set it up you can use it to manage your Ribbon integration on your website.

Google Tag Manager should be installed on your website before you follow this guide. If you have not yet installed Google Tag Manager you can follow this guide from Google to get it set up.

Integrate Wondering with Google Tag Manager

From the Wondering dashboard, click Integration > JavaScript SDK:

Next, make a note of your Wondering ID, which you can find on the JavaScript SDK page - this is used to identify your organisation.

Now, in order to integrate Wondering to your website with Google Tag Manager:

  1. Add Ribbon tag template to your Google Tag Manager Container.
    • Go to the Templates tab > Tag Templates > Search Gallery
    • Search for "Wondering" - you should now see the Wondering template. Click on the Wondering template and then hit Add to workspace.

  1. In the Tags tab, add a new tag which uses the Ribbon template under Choose tag type.
    • In the Tag Configuration section, use the tag’s Method Load script, and fill the field _Wondering ID _with your Wondering ID found earlier on the JavaScript SDK page on wondering.com
    • In the Triggering section, add the trigger you would like to use to initialise the Wondering integration. Typically this is done on page load, for example using the default Initialisation - All Pages.
    • Save the tag.
  2. Now you have added the tag, for the integration to work, you need to publish your changes. You can do this in the top right by clicking "Submit", naming your version and clicking "Publish".

You will now successfully have Wondering integrated, and you can recruit anyone visiting your website. Further integration following the steps below will allow improved targeting with attributes and triggers.

📘

On loading of the Wondering Tag, a "Visits any page" trigger will fire, indicating that a page was visited by the user. If users are identified using Identify and User attributes after this trigger fires, they may not be associated with this trigger. Make sure each attribute is set before the trigger loads.

Identify users

In the Tags tab, add a new tag which uses the Wondering template under Choose tag type. This should use the tag’s Method "Identify". Here you are able to add a variable to the identity for your users - note that this should be unique value for each user.

In the Triggering section, you should add the Google Tag Manager trigger you would like to fire the Wondering trigger on - note that this should run on page load, before any triggers are activated.

Add Triggers

In the Tags tab, add a new tag which uses the Wondering template under Choose tag type. This should use the tag’s Method "Trigger". Then you can simply add the Wondering trigger name in the Trigger text box.

Now in the Triggering section, add the Google Tag Manager trigger you would like to fire the Wondering trigger on.

Add User Attributes

In the Tags tab, add a new tag which uses the Wondering template under Choose tag type. This should use the tag’s Method "Attributes". Then you can add rows to the key value table shown in the tag. After you have added all the attributes close the tag configuration.

In the Triggering section below, add the Google Tag Manager trigger you would like to fire the Wondering trigger on.

Troubleshooting

🚧

If your website also uses the Javascript SDK to send attributes, triggers or identify users, you may encounter errors if commands aren't run after your Wondering tag has loaded through Google Tag Manager.

Additionally, if you run multiple Wondering tags on a page loading, the Wondering script may be loaded twice. This may introduce javascript errors - to fix this, you will need to specify your tag run order to ensure only one fires initially.