Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

gtag.js implementation in Direct call rule result in error _satellite is not defined

Avatar

Avatar
Validate 1
Level 3
gokula
Level 3

Likes

25 likes

Total Posts

86 posts

Correct Reply

7 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Ignite 3
Ignite 1
View profile

Avatar
Validate 1
Level 3
gokula
Level 3

Likes

25 likes

Total Posts

86 posts

Correct Reply

7 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Ignite 3
Ignite 1
View profile
gokula
Level 3

11-06-2019

Hello Team, 

We re working on Single page application (SPA) based in ReactJS framework, we have a requirement to implement gtag.js for tracking purpose.

in terms of SPA, we are going to be implemented gtag in direct call rule where we have only 3 options are available (Non-sequential JS /Non-sequential HTML / Sequential JS).

we chose Non-Sequential HTML and implemented in the following way

<!--

Start of global snippet: Please do not remove

Place this snippet between the <head> and </head> tags on every page of your site.

-->

<!-- Global site tag (gtag.js) - Google Marketing Platform -->

<script async src="https://www.googletagmanager.com/gtag/js?id=DC-XXXXXXX"></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'DC-XXXXXXX');

</script>

<!-- End of global snippet: Please do not remove -->

<!--

-->

<script>

  gtag('event', 'purchase', {

    'allow_custom_scripts': true,

    'transaction_id': _satellite.getVar("data-element-is-in-place"),

    'send_to': 'DC-XXXXXXX/nudhomsa/aplus0+transactions'

  });

</script>

<!-- End of event snippet: Please do not remove -->

This result is below

1770341_pastedImage_1.png

if we expand the above error

1770342_pastedImage_2.png

Any idea? How can we resolve this?

Help appreciated.

Thanks 

Accepted Solutions (0)

Answers (0)