Installing with Google Tag Manager

Step-by-step instructions to set up Userlove using GTM

Create New Tag and install Userlove SDK snippet

  1. Log in to your Google Tag Manager account and navigate to the desired container.

  2. Click on the "Tags" tab and then click the "New" button.

  3. Select "Custom HTML" as the tag type.

  4. Give your tag a descriptive name. ie: Userlove

  5. In the "HTML" field, paste the Userlove SDK Snippet code for your custom tag.

  6. Under "Triggering", select All Pages

  7. Click "Save" to create your custom HTML tag.

  8. Publish your changes to make the tag live on your website.

Note: You can modify triggering as per your requirement, but please note that Userlove can only show experiences wherever the code snippet is loaded.

Identify users

How to Identify and send user properties to Userlove? To show the right content to the right users at the right time, you must identify users with the "identify" event and send their data to Userlove.

It's requires to pass a "id" (YOUR_USER_ID), Name and Email to userlove() function as per the instructions below, you can leverage this information for better targeting and personalizing experiences.

  1. In your GTM account, navigate to the "Tags" section and click "New".

  2. Choose "Custom HTML" as the tag type.

  3. Copy and paste Userlove identify event snippet in HTML section

  4. You will need to pass your user id, user name and user email as variables in GTM you can also pass additional information that you want to use for targeting to user for personalised experiences

  5. Set trigger (Please trigger identify event as soon as user logged into your application)

  6. Give your tag a name and click "Save".

We recommend passing as much information as possible about your users. The more data you provide, the better we can target and personalize the onboarding experience for each user.

Events Tracking

By tracking events in your application, It's allow you to show Userlove's content based on what actions user have or haven't taken. This can also help you see how your content affects user behavior.

  1. In your GTM account, navigate to the "Tags" section and click "New".

  2. Choose "Custom HTML" as the tag type.

  3. Copy and paste Userlove Event Tracking snippet in HTML section

  4. You can also send additional data to Userlove with your custom event

  5. Give your tag a name and click "Save".

You can use following event tracking code to track any custom event and send data to Userlove platform, you can modify this code as per your requirement

<script>
userlove("track", {
  event: "Plan Upgrade", // Replace with your custom event name
  data: {
    // Replace with your custom event data
    plan: "Growth",
    term: "Monthly",
    price: 99,
    renewal_date: 1680000401,
  },
});
</script>

Last updated