Please note this will only work for publications that have been embedded into your site via our Publicator Embed Code, and will not work with direct publications links/URLs.
This article will cover the steps necessary to connect Publicator with GA4, specifically when implemented with GTM. The first step is to contact support@zmags.com and your CSM, and request for this implementation to be set-up. Our team will responded with an updated version of the Publicator Embed Code that is designed to work with GA4.
After you receive this embed code, you'll also need to create a GA4 Custom Event Tag by following these steps:
Step 1: Create New Variables
- Go to "Variables" on the left-hand menu.
- Under "User-Defined Variables," click "New." Create the following variables by selecting the variable type as "Data Layer Variable":
- Event Type Variable
- Variable Name:
interaction_Type
- Data Layer Variable Name:
type
- Purpose: Captures the type of event (e.g., "pageChange", "toolbar", "productWidget", "productLink").
- Variable Name:
- Publication Title Variable
- Variable Name:
publication_Title
- Data Layer Variable Name:
publicationTitle
- Purpose: Captures the title of the publication.
- Variable Name:
- Publication ID Variable
- Variable Name:
publication_ID
- Data Layer Variable Name:
publicationId
- Purpose: Captures the ID of the publication.
- Variable Name:
- First Page Variable (for Page Change Events)
- Variable Name:
first_Page
- Data Layer Variable Name:
firstPage
- Purpose: Captures the first page number in a page change event.
- Variable Name:
- Last Page Variable (for Page Change Events)
- Variable Name:
lastPPage
- Data Layer Variable Name:
lastPage
- Purpose: Captures the last page number in a page change event.
- Variable Name:
- Toolbar Button ID Variable (for Toolbar Events)
- Variable Name:
toolbar_Button_ID
- Data Layer Variable Name:
button
- Purpose: Captures the ID of the toolbar button that was activated.
- Variable Name:
- Product ID Variable (for Product Widget and Product Link Events)
- Variable Name:
product_ID
- Data Layer Variable Name:
product
- Purpose: Captures the product ID in product widget and product link activation events.
- Variable Name:
- Event Type Variable
- For each variable, set the "Data Layer Variable Name" to match the variable name (for example, "Publication Title" for the first one).
- Click "Save."
Step 2: Create New Trigger
- Go to "Triggers" on the left-hand menu.
- Click "New" to create a new trigger.
- Choose "Trigger Type" as "Custom Event."
- Enter "Event name" as "publicatorEvent."
- Set this trigger to fire on "All Custom Events".
- Click "Save."
Step 3: Create New Tag
- Go to "Tags" on the left-hand menu.
- Click "New" to create a new tag.
- Set up your tag with your desired configuration. (e.g., if you are sending data to Google Analytics, choose "Universal Analytics").
- Choose "Track Type" according to your needs (e.g., "Event").
- Configure the tag settings and under the event tracking parameters, use the variables you've set up. You can put {{Publication Title}}, {{Publication ID}}, {{First Page}}, {{Last Page}}, {{Toolbar Button ID}}, {{Product ID}} in the respective fields.
- Under "Triggering," choose the "publicatorEvent" trigger you created.
- Please ensure there are no spaces in the event parameter name. Add an underscore if necessary.
- Click "Save."
Comments
0 comments
Please sign in to leave a comment.