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 click event Network Status "cancelled"

Avatar

Avatar
Validate 1
Level 1
dannye52454320
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
dannye52454320
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
dannye52454320
Level 1

02-01-2019

Hello fellow DTMers,

Having an issue where I'm adding some Non-Sequential JS to a click event in DTM.

The event fires perfectly fine, but the gtag conversion is being cancelled. I am testing in Chrome, is this the issue?

Moreover, if I make gtag conversions tied to specific URL page loads, they fire perfectly fine. Does it have to do with the fact that the AdWords/DCM Universal Tag is implemented using Sequential HTML? Should I translate this to Non-Sequential JavaScript?

If so, how do I translate the beginning of the tag below from HTML to JS (the <script async src=....></script>)?

Best,

Danny

<!-- Global site tag (gtag.js) - Google Ads: xxxxxxxxx -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-xxxxxxxxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-xxxxxxxxx');
gtag('config', 'DC-xxxxxxx');
</script>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct Reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile
StewSchilling
MVP

04-01-2019

If the link click that is being tracked is a navigational link (one that causes you to leave the current page and navigate to another), you may be seeing this issue because the current page is being unloaded at the same time that you are trying to execute some code.

Selecting `Delay Link Activation` on the rule's condition may give you the time you need to execute your actions before navigation takes place.

Beyond this,  I would switch to sequential JS from non-sequential JS for the click action.

Also, assuming that you are loading the Global Site tag when the page loads, you should be able to call the `gtag` function directly from your sequential JS.  You will not need to get gtag.js again since it should already be on the page.

Answers (0)