Skip to content

Commit

Permalink
fix(GTM): Fixed error given by data layer when using server-side rend…
Browse files Browse the repository at this point in the history
…ering (#321)
  • Loading branch information
sebastiannm authored and scttcper committed Dec 5, 2018
1 parent 65fe8d0 commit bee8cf2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/providers/gtm/gtm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ export class Angulartics2GoogleTagManager {
* @layer data layer object
*/
pushLayer(layer: any) {
if (typeof dataLayer === 'undefined' && !dataLayer) {
return;
if (typeof dataLayer !== 'undefined' && dataLayer) {
dataLayer.push(layer);
}

dataLayer.push(layer);
}

/**
Expand Down

0 comments on commit bee8cf2

Please sign in to comment.