For Privy users who don't want to add the Privy code to their website code or integrate with their eCommerce platform, there is a way to install Privy through adding the code in Google Tag Manager (GTM). Installing Privy via GTM allows for an easy way to manage Privy code. Utilizing a GTM container allows for the Privy code to be managed through Google, and allows for an easy experience to add/remove Privy if you have multiple sites that you are managing.
- If you install Privy manually on your site or though the integration, you should not install Privy through GTM as well. This is an alternative way to install Privy on your site.
- If you install Privy through GTM, the following functionality will be lost within Privy versus installing through your eCommerce platform integration.
- Google Analytics tracking for view and signup events of Privy onsite campaigns will not function.
- Cart Value, Product/Variant ID, and Order Count targeting for onsite and newsletter email campaigns will not work.
- Abandoned Cart and Order Follow-Up emails will not work with Privy installed via GTM.
- Campaign Revenue will not be detected and displayed in your dashboard.
First, you will need to go into your GTM account and add a new tag.
Once you have added a new tag, go into the business settings of your Privy account to the Privy Code section and copy the default code for your account.
Next, go back into your GTM account and name and select "Tag Configuration" to create your Tag.
A menu will appear on the right side of your window which lists out the tag type options, select "Custom HTML" as your Tag Type.
Next, paste in your code and save the tag.
Upon saving, the following message will appear, click the "Add Trigger" option.
In the flyout that appears, click the "+" to add a new Trigger
Next, name your trigger and select Trigger Configuration.
Select Page View as a Trigger Type
Next, select "All Page Views", confirm your Trigger Name is still saved, and then save your trigger.
Once you have selected all pages views and saved, you will "Save" your Trigger and Tag.
After that, don't forget to select the "Submit" button to finalize your trigger and tag.
After submitting, you will have the option to give this version a name and description. You will want this version name and description to indicate the changes you are making of adding the Privy code to your GTM account to install the Privy app on your site. Once you have given your version a name and description, don't forget to publish by selecting the "Publish" button!
Now that you have set up your Privy Code trigger and tag, every time someone visits a page on your site (the trigger) the tag (Privy Code) will run so that any campaigns that you would like to display on that page will appear.