@mjhls/mjh-framework 1.0.966-testV6 → 1.0.966-testV7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/View.js CHANGED
@@ -2130,9 +2130,10 @@ var ArticleQueue = function ArticleQueue(props) {
2130
2130
  changeMeta(meta);
2131
2131
  }
2132
2132
  if (props.setCustomDimensions) {
2133
- props.setCustomDimensions(activeArticle, '200', prevUrl, '', true);
2133
+ props.setCustomDimensions(activeArticle, '200', prevUrl, '');
2134
2134
  }
2135
- // if (props.pageview) props.pageview(newPath, pageviewProperties)
2135
+ if (props.pageview) props.pageview(newPath, null, pageviewProperties);
2136
+ if (props.gtagSetCustomDimensions) props.gtagSetCustomDimensions(activeArticle, '200', prevUrl, '', true);
2136
2137
  refreshAD(path);
2137
2138
  };
2138
2139
 
@@ -2174,6 +2175,7 @@ var View = function View(props) {
2174
2175
  props.sponsoredTaxonomies;
2175
2176
  var Ads = props.Ads,
2176
2177
  setCustomDimensions = props.setCustomDimensions,
2178
+ gtagSetCustomDimensions = props.gtagSetCustomDimensions,
2177
2179
  statusCode = props.statusCode,
2178
2180
  prevUrl = props.prevUrl,
2179
2181
  pageview = props.pageview,
@@ -2200,18 +2202,30 @@ var View = function View(props) {
2200
2202
  React.useEffect(function () {
2201
2203
  if (pageview && setCustomDimensions) {
2202
2204
  var timer = void 0;
2203
- _extends._extends({}, getTargeting.getTargeting(props), {
2205
+ var pageviewProperties = _extends._extends({}, getTargeting.getTargeting(props), {
2204
2206
  category: article && article.category ? article.category.name : ''
2205
2207
  });
2206
2208
  var waitAndExicute = function waitAndExicute() {
2207
2209
  if (typeof window.GA_INITIALIZED !== 'undefined') {
2208
- setCustomDimensions(article, statusCode, prevUrl, '', false);
2210
+ setCustomDimensions(article, statusCode, prevUrl, '');
2211
+ pageview(router.asPath, null, pageviewProperties);
2209
2212
  } else timer = setTimeout(waitAndExicute, 1000);
2210
2213
  };
2211
2214
  waitAndExicute();
2212
2215
  return function () {
2213
2216
  clearTimeout(timer);
2214
2217
  };
2218
+ } else if (gtagSetCustomDimensions) {
2219
+ var _timer = void 0;
2220
+ var _waitAndExicute = function _waitAndExicute() {
2221
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
2222
+ gtagSetCustomDimensions(article, statusCode, prevUrl, '', false);
2223
+ } else _timer = setTimeout(_waitAndExicute, 1000);
2224
+ };
2225
+ _waitAndExicute();
2226
+ return function () {
2227
+ clearTimeout(_timer);
2228
+ };
2215
2229
  }
2216
2230
  }, []);
2217
2231
 
package/dist/esm/View.js CHANGED
@@ -2120,9 +2120,10 @@ var ArticleQueue = function ArticleQueue(props) {
2120
2120
  changeMeta(meta);
2121
2121
  }
2122
2122
  if (props.setCustomDimensions) {
2123
- props.setCustomDimensions(activeArticle, '200', prevUrl, '', true);
2123
+ props.setCustomDimensions(activeArticle, '200', prevUrl, '');
2124
2124
  }
2125
- // if (props.pageview) props.pageview(newPath, pageviewProperties)
2125
+ if (props.pageview) props.pageview(newPath, null, pageviewProperties);
2126
+ if (props.gtagSetCustomDimensions) props.gtagSetCustomDimensions(activeArticle, '200', prevUrl, '', true);
2126
2127
  refreshAD(path);
2127
2128
  };
2128
2129
 
@@ -2164,6 +2165,7 @@ var View = function View(props) {
2164
2165
  props.sponsoredTaxonomies;
2165
2166
  var Ads = props.Ads,
2166
2167
  setCustomDimensions = props.setCustomDimensions,
2168
+ gtagSetCustomDimensions = props.gtagSetCustomDimensions,
2167
2169
  statusCode = props.statusCode,
2168
2170
  prevUrl = props.prevUrl,
2169
2171
  pageview = props.pageview,
@@ -2190,18 +2192,30 @@ var View = function View(props) {
2190
2192
  useEffect(function () {
2191
2193
  if (pageview && setCustomDimensions) {
2192
2194
  var timer = void 0;
2193
- _extends({}, getTargeting(props), {
2195
+ var pageviewProperties = _extends({}, getTargeting(props), {
2194
2196
  category: article && article.category ? article.category.name : ''
2195
2197
  });
2196
2198
  var waitAndExicute = function waitAndExicute() {
2197
2199
  if (typeof window.GA_INITIALIZED !== 'undefined') {
2198
- setCustomDimensions(article, statusCode, prevUrl, '', false);
2200
+ setCustomDimensions(article, statusCode, prevUrl, '');
2201
+ pageview(router.asPath, null, pageviewProperties);
2199
2202
  } else timer = setTimeout(waitAndExicute, 1000);
2200
2203
  };
2201
2204
  waitAndExicute();
2202
2205
  return function () {
2203
2206
  clearTimeout(timer);
2204
2207
  };
2208
+ } else if (gtagSetCustomDimensions) {
2209
+ var _timer = void 0;
2210
+ var _waitAndExicute = function _waitAndExicute() {
2211
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
2212
+ gtagSetCustomDimensions(article, statusCode, prevUrl, '', false);
2213
+ } else _timer = setTimeout(_waitAndExicute, 1000);
2214
+ };
2215
+ _waitAndExicute();
2216
+ return function () {
2217
+ clearTimeout(_timer);
2218
+ };
2205
2219
  }
2206
2220
  }, []);
2207
2221
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.966-testV6",
3
+ "version": "1.0.966-testV7",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",