cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
4321members
1416posts
InvocaKnowledge
Community Manager
Community Manager

Objective

Capture attribution for the Google Session ID.

Applies To

  • Customers using Invoca's Google Anlaytics 4 integration
  • Customers integrated with multiple Google Analytics properties
  • Customers utilizing Google Tag Manager to manage their GA4 Tags.

Procedure

  1. Go to Templates in the Google Tag Manager UI, and search for GTAG GET API in the template gallery. Once you find the template, click Add to workspace to install the template.
  2. Go to Tags and create a new tag. Use the GTAG GET API template as the tag type.
  3. Set the GA4 Measurement ID in the appropriate field.
  4. Select the box next to Session ID under Default Fields to Get.gtag-api-configured.jpg
  5. Next, you need to add this tag in a tag sequence, so that it fires after your GA4 Configuration tag (or Event tag, if you’re not using the Configuration tag). To add the tag in the sequence, open your Google Analytics 4: Configuration tag, and scroll to Advanced Settings -> Tag Sequencing.
  6. Check the box next to Fire a tag after … fires, and select the tag you created from the custom template in the drop-down list. This is what it would look like:gtag-tag-sequencing.jpg
  7. If you now go to Preview mode and test your setup, you should see a new Data Layer event named gtagApiGet in the event list. If you don’t see it, it’s most likely because you don’t have a GA4 configuration on the page, or it’s because the API tag fired before gtag() had time to load.gtag-api-get-preview.jpg
  8. Create a Marketing Data field for the Google Analytics Session ID. 

    Type: Short text
    Partner API Name: ga_session_id
    Friendly Name: Google Analytics Session ID
    Attribution Model: Last
  9. Update your Invoca Tag to capture the Google Analytics cookie that stores the session ID.
    • Click the gear icon and click Invoca Tags. Find the Invoca Tag that is implemented on the website that tracks the GA4 Property you are integrating.
    • Click into the Revision History tab and either create a New Draft (be sure you click the New Draft button and not the New Tag button!) or continue editing an existing draft. 
    • On the Tag draft page, find the Google Analytics Session ID parameter in the Marketing Data section. 
    • Set the Data Source Type to JavaScript Data Layer and paste the variable name for the Session ID as the Data Source Name.
  10. Follow the steps in this documentation to test that the Session ID attribution is being captured as expected before deploying your draft.
 

Additional Information

See the GA4 Integration Guide for steps on adding the Session ID to your GA4 integration.

Need more help?

Don't see what you are looking for? You can ask the Community or contact support.