How to send search data from Google Tag Manager to Amplitude
Cludo Google Tag Manager events are perfectly suited for analytics platforms with an event-driven architecture. One popular example of such a platform is Amplitude. Integrating search events into Amplitude can reveal powerful insights about the visitor’s journey.
Before getting started
In order to correctly send search data for Google Tag Manager to Amplitude, the following items are needed:
- An Amplitude account.
- The API key for an active project within the Amplitude account.
- The Cludo GTM integration enabled within MyCludo.
- Custom GTM variables created for any parameters to be send to Amplitude with search events
- Usually includes the search term at minimum
- Custom GTM triggers created for the Cludo events to track
- Usually searches, clicks, or both
Initialize Amplitude tracking on every page
The first step is to initialize Amplitude tracking on every page, using the Amplitude tag in GTM.
The Amplitude tag can be found in the GTM Community Template Gallery. The majority of users will need the Amplitude Analytics Browser SDK tag.
- In the tag configuration options, paste your Amplitude API key and set the tag type to ‘init’.
- Optional: Set settings in the Initialization and Advanced Settings sections.
- Under triggering, set the trigger to Initialization – All Pages.
- Give your tag a unique Name.
- Click the Save button.
Add Amplitude tag with search events to track
Next step is to add specific search events, which should be sent to Amplitude.
- Head back to the Community Template Gallery, and select another Amplitude Analytics Browser SDK tag.
- Again enter your API key in the tag configuration.
- Set the Tag Type to track which will reveal some additional options for how to track search events.
- Under Event type give the event a descriptive name, for example “View search results”. This is how the event will be labeled within the Amplitude.
- Ad some event properties to send with each event. These properties require a unique Name and a Value which is usually set to a predefined GTM variable. Event properties are technically optional; at minimum, adding “search term” it is recommended.
- Set a trigger to one of the predefined Cludo event triggers – generally a search or click event.
- Give the tag a unique Name.
- Click the Save button.
Publish the changes
Once the tag(s) are added, it is time to preview or publish the changes. Clicking the Preview button in the GTM workspace will show the changes in a debugger window. Using the preview function, the search events can be manually triggered to verify the Amplitude dashboard is receiving the data correctly from GTM.
Events may take up to an hour to before appearing in Amplitude.
- Once confident, click the Publish button and publish the changes.
- Attempt to trigger the tag by visiting a page, and verify the data is sent correctly to Amplitude.
Experiment with the Amplitude events
At this stage check out Amplitude’s documentation to learn about the different ways, events can be used to analyze the visitor journey. The search data can now answer questions like:
- What are visitors searching for before they convert? What about before they bounce from the site?
- How does the conversion rate differ for users searching from mobile vs. desktop?
- What pages lead a high volume of users to the search page? Can we provide the content they’re looking for on these origin pages instead?
- And much more!