Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8822073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:00:43+00:00 2026-06-14T06:00:43+00:00

I have two Google Analytics profiles in my account. One, for my production account

  • 0

I have two Google Analytics profiles in my account. One, for my production account with property ID: UA-XXXXXXXX-1. My second profile is for my staging account to test and it has property ID: UA_XXXXXXXX-2.

In tag manager I have my “-1” tag firing if my url includes “mydomain.com” and my “-2” tag firing if url includes “mydomain.it”.

The firing of the GA tag with this setup works fine. I have my staging data separate from production and am able to test basic GA pageviews.

What now need is the ability to separate events. Currently, I call setAccount prior to each event tracking (I know this can be in single call).

_gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);

What I’d like to do is call the _setAccount method and dynamically pass in the value from Google Tag Manager where I set the property ID depending on the url.

Is there a way to do something like this (or something better) so I can set the account based on a Tag Manager rule?

_gaq.push(['_setAccount', [Tag Manager Property ID] ]);

I appreciate any advice/help you have.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:00:45+00:00Added an answer on June 14, 2026 at 6:00 am

    IMO passing data from the tag manager to the website, apart from all practical difficulties, would totally defeat the purpose of having asychronous loading code.

    You “push” methods on a stack so you can process them when the code has loaded at some undetermined point in the future. If you want to take the account id from the code you’d have to wait until it’s loaded, so you’d loose all advantages from asynchronous loading.

    As far as I can tell (haven’t used tag manager extensively yet) the correct way would be to push the event data to the “data layer” variable :

    dataLayer.push({'myevent': 'mylabel'});
    

    and use the variable (like dataLayer.myevent) in the code deployed via the tag manager (so you do the actual event tracking in the domain specific code).

    This is described at: https://developers.google.com/tag-manager/devguide

    There is actually an event tracking template for Google Analytics in the tag manager. For the event value you can create a new macro and set it to a dataLayer variable. Then add your domain specific rule and you should be all set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two text file. file1.txt has: gedit google chrome git vim foo bar
I have two profiles in Google Chrome. I am trying to load a different
Just been looking through my Google analytics and have found two entries for the
I am developing an android application in I have two GeoPoints in Google map.One
I have two imports that I need to use: import net.robotmedia.billing.model.Transaction; import com.google.analytics.tracking.android.Transaction; and
I have two locations (markers) to display on a google map, one is a
I am using google analytics and have a filter for one of the websites
I'm having this problem: I have two Google maps in one page, showing just
I have two apps on Google App Engine, both running under the same account,
I have two issues in this google chart. I want to either get rid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.