Google Analytics 4 (GA4) Integration Guide
How to Integrate with Google Analytics 4 (GA4)
Google Analytics 4 (GA4) is a next-generation tool that collects and analyzes visitor data from websites and apps. By integrating Ptengine with GA4, you can send interaction data such as popups, page edits, and A/B tests to GA4, enabling more detailed analysis. Below, we explain the integration method in detail.
Prerequisites for Integration
GA4 code is already installed on your website
If using Google Tag Manager (GTM), place the Ptengine tag after the GA code.
Once GA4 integration is configured, you do not need to repeat the setup for each new Experience thereafter.
Not all data integrations are supported. Redirect-type Experience interaction data transmission is not supported.
How to Enable GA4 Integration in Ptengine
To enable GA4 integration, follow these steps:
Log in and access the relevant account.
Click the ⚙ in the top right corner and click "Integration" in the displayed menu. It will look like the figure below: On this page, profile-level push activation is provided, and enabling it will apply to all subsequent Experiences by default.
Click the Google Analytics 4 card and expand it as shown in the figure below, then click "Enable Immediately".
The operations within Ptengine are now complete.
Setting Up Experience Variables as Custom Dimensions in GA4
After enabling GA4 integration in Ptengine, you need to map Experience variables to GA4. This allows you to send experiment data to GA4. Follow the steps below:
Sign in to your GA4 account.
From the main menu panel on the left, go to [Administration] → [Custom Definitions] → [Create Custom Dimension]. The operation screen will look like this:
Create a custom dimension in the new custom dimension popup window.
💡Custom Dimension Explanation: Dimension Name Enter the name of the custom dimension as the name of the Experience variable.
Events That Can Be Sent to GA4
In Advanced mode, there may be multiple popups. To ensure the accuracy of A/B tests, in this mode only one event package can be sent per Page View Experience. (pt_experience_impression, pt_experience_close, pt_experience_click)
Validating the Integration Configuration
After mapping the Experience variables in GA4, you can verify that data is being sent correctly from Ptengine to GA4 by validating network requests. Follow the steps below:
On the Experience popup page, right-click and select "Inspect Element".
Select the "Network" tab and search for "analytics.google.com" to filter GA4 network requests.
If you can see events such as "pt_experience_impression" displayed, it confirms that Ptengine is successfully sending events to GA4.
Note: Since GA4 data processing takes time, it may take 24-48 hours after enabling integration before data appears in GA4. Please wait.
About GA4 Integration Issues
If you installed using "Google tag" with Google Tag Manager (GTM), GA4 may not be able to collect data from Ptengine.
Solution
To ensure smooth integration between Ptengine and GA4, place the following tag before the Ptengine base tag.
※ You need to replace "G- set your GA4 sid" in the code with your site's GA4 sid.
🔰How to Get GA4 sid
Enter the GA4 admin screen.
Press the "Data Stream" button under "Data Collection and Modification".
Select the specified data stream and confirm the "Measurement ID".
After confirming the "Measurement ID", replace "G- set your GA4 sid" above with the "Measurement ID", and the gtag configuration is complete.
Creating GA4 Data Exploration and Adding Segments
Go to "Exploration" and select a type of data exploration or start from a blank state.
In the "Variables" panel on the left, click the plus icon next to "Segment". On the "Create New Segment" page, click "User Segment".
Enter the name of the segment. For example, a specific experience or version name.
Expand the "Add Description" dropdown, click "Event", and select "pt_experience_impression" or "pt_experience_click" (varies depending on the segment you want to create).
Click the "Add Parameter" dropdown.
Click "Custom" and select pt_experience_name.
Select or specify the specific experience name for which you want to create this segment.
If you want to specify a specific version, click the "Add Parameter" dropdown again, add another parameter, click pt_experience_version_name, and select or specify the specific version name for which you want to create this segment.
Click "Save" and you can then use the segment in reports.
Creating GA4 Audiences
Go to "Administration", select "Audience", and click "Audience".
On the "Create Audience" screen, expand the "Add New Condition" dropdown, click "Event", and select pt_experience_impression or pt_experience_click (varies depending on the audience you want to create). For example, if you want to create an audience for users who were shown an exit intent popup, select the event pt_experience_impression, click "Add Parameter", select pt_experience_name, set the condition to "contains", and enter the "experience name".
If you cannot find the event or event property in the dropdown, it's possible that the data has not yet been synchronized to GA4. In that case, you can create a new event by clicking "Create Event" or "Register New Definition".
Click "Save" to save the audience. Usually, it may take 24-48 hours for data to be reflected in the audience.
After creating the audience, you can use it in reports.
最終更新